Skip to content

Commit cba0dec

Browse files
Use Yii2 22. (#279)
1 parent 2aedc68 commit cba0dec

21 files changed

+142
-165
lines changed

.editorconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,6 @@ trim_trailing_whitespace = true
1212

1313
[*.md]
1414
trim_trailing_whitespace = false
15+
16+
[*.yml]
17+
indent_size = 2

.github/workflows/build.yml

Lines changed: 18 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,22 @@
1-
name: build
1+
on:
2+
pull_request:
3+
paths-ignore:
4+
- 'docs/**'
5+
- 'README.md'
6+
- 'CHANGELOG.md'
7+
- '.gitignore'
8+
- '.gitattributes'
29

3-
on: [push, pull_request]
10+
push:
11+
paths-ignore:
12+
- 'docs/**'
13+
- 'README.md'
14+
- 'CHANGELOG.md'
15+
- '.gitignore'
16+
- '.gitattributes'
417

5-
env:
6-
DEFAULT_COMPOSER_FLAGS: "--prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi"
18+
name: build
719

820
jobs:
9-
phpunit:
10-
name: PHP ${{ matrix.php }} on ${{ matrix.os }}
11-
runs-on: ${{ matrix.os }}
12-
strategy:
13-
fail-fast: false
14-
matrix:
15-
os: [ubuntu-latest]
16-
php: ['5.4', '5.5', '5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0']
17-
18-
steps:
19-
- name: Checkout
20-
uses: actions/checkout@v2
21-
- name: Install PHP
22-
uses: shivammathur/setup-php@v2
23-
with:
24-
php-version: ${{ matrix.php }}
25-
- name: Get composer cache directory
26-
id: composer-cache
27-
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
28-
- name: Cache composer dependencies
29-
uses: actions/cache@v1
30-
with:
31-
path: ${{ steps.composer-cache.outputs.dir }}
32-
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
33-
restore-keys: ${{ runner.os }}-composer-
34-
- name: Install dependencies
35-
run: composer update $DEFAULT_COMPOSER_FLAGS
36-
- name: Run unit tests with coverage
37-
run: vendor/bin/phpunit --verbose --coverage-clover=coverage.clover --colors=always
38-
if: matrix.php == '7.1'
39-
- name: Run unit tests without coverage
40-
run: vendor/bin/phpunit --verbose --colors=always
41-
if: matrix.php != '7.1'
42-
- name: Upload code coverage
43-
run: |
44-
wget https://scrutinizer-ci.com/ocular.phar
45-
php ocular.phar code-coverage:upload --format=php-clover coverage.clover
46-
if: matrix.php == '7.1'
47-
continue-on-error: true # if is fork
21+
phpunit:
22+
uses: yiisoft/actions/.github/workflows/phpunit.yml@master

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,7 @@ phpunit.phar
3030
/tests/docker
3131
/tests/dockerids
3232

33+
# nodejs
34+
/node_modules
35+
/package-lock.json
36+
.phpunit.result.cache

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ Documentation is at [docs/guide/README.md](docs/guide/README.md).
1818
[![Total Downloads](https://poser.pugx.org/yiisoft/yii2-bootstrap/downloads.png)](https://packagist.org/packages/yiisoft/yii2-bootstrap)
1919
[![Build Status](https://github.com/yiisoft/yii2-bootstrap/workflows/build/badge.svg)](https://github.com/yiisoft/yii2-bootstrap/actions)
2020

21+
Requirements
22+
------------
23+
24+
- PHP 8.1 or higher.
2125

2226
Installation
2327
------------
@@ -27,13 +31,13 @@ The preferred way to install this extension is through [composer](https://getcom
2731
Either run
2832

2933
```
30-
php composer.phar require --prefer-dist yiisoft/yii2-bootstrap
34+
php composer.phar require --prefer-dist yiisoft/yii2-bootstrap:^22.x-dev
3135
```
3236

3337
or add
3438

3539
```
36-
"yiisoft/yii2-bootstrap": "~2.0.0"
40+
"yiisoft/yii2-bootstrap": "^22.x-dev"
3741
```
3842

3943
to the require section of your `composer.json` file.

composer.json

Lines changed: 14 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
{
22
"name": "yiisoft/yii2-bootstrap",
33
"description": "The Twitter Bootstrap extension for the Yii framework",
4-
"keywords": ["yii2", "bootstrap"],
4+
"keywords": [
5+
"yii2",
6+
"bootstrap"
7+
],
58
"type": "yii2-extension",
69
"license": "BSD-3-Clause",
710
"support": {
@@ -32,42 +35,26 @@
3235
}
3336
],
3437
"require": {
35-
"yiisoft/yii2": "~2.0.6",
36-
"bower-asset/bootstrap": "3.4.* | 3.3.* | 3.2.* | 3.1.*"
38+
"php": ">=8.1",
39+
"yiisoft/yii2": "22.0.x-dev"
3740
},
3841
"require-dev": {
39-
"cweagans/composer-patches": "^1.7",
40-
"phpunit/phpunit": "4.8.34"
42+
"php-forge/foxy": "^0.1",
43+
"phpunit/phpunit": "^9.6",
44+
"yiisoft/yii2-coding-standards": "~2.0"
4145
},
42-
"repositories": [
43-
{
44-
"type": "composer",
45-
"url": "https://asset-packagist.org"
46-
}
47-
],
4846
"autoload": {
4947
"psr-4": {
5048
"yii\\bootstrap\\": "src"
5149
}
5250
},
53-
"extra": {
54-
"branch-alias": {
55-
"dev-master": "2.0.x-dev"
56-
},
57-
"patches": {
58-
"phpunit/phpunit-mock-objects": {
59-
"Fix PHP 7 and 8 compatibility": "https://yiisoft.github.io/phpunit-patches/phpunit_mock_objects.patch"
60-
},
61-
"phpunit/phpunit": {
62-
"Fix PHP 7 compatibility": "https://yiisoft.github.io/phpunit-patches/phpunit_php7.patch",
63-
"Fix PHP 8 compatibility": "https://yiisoft.github.io/phpunit-patches/phpunit_php8.patch"
64-
}
65-
}
66-
},
6751
"config": {
6852
"allow-plugins": {
69-
"cweagans/composer-patches": true,
70-
"yiisoft/yii2-composer": true
53+
"yiisoft/yii2-composer": true,
54+
"php-forge/foxy": true
7155
}
56+
},
57+
"extra": {
58+
"foxy": true
7259
}
7360
}

package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"dependencies": {
3+
"bootstrap3": "npm:bootstrap@^3.4.1"
4+
}
5+
}

phpunit.xml.dist

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,22 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<phpunit bootstrap="./tests/bootstrap.php"
3-
colors="true"
4-
verbose="true"
5-
convertErrorsToExceptions="true"
6-
convertNoticesToExceptions="true"
7-
convertWarningsToExceptions="true"
8-
stopOnFailure="false">
9-
<testsuites>
10-
<testsuite name="Test Suite">
11-
<directory>./tests</directory>
12-
</testsuite>
13-
</testsuites>
2+
<phpunit
3+
bootstrap="./tests/bootstrap.php"
4+
colors="true"
5+
convertErrorsToExceptions="true"
6+
convertNoticesToExceptions="true"
7+
convertWarningsToExceptions="true"
8+
stopOnFailure="false"
9+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.6/phpunit.xsd"
11+
>
12+
<testsuites>
13+
<testsuite name="Yii2-Bootstrap">
14+
<directory>./tests</directory>
15+
</testsuite>
16+
</testsuites>
17+
<coverage>
18+
<include>
19+
<directory suffix=".php">src</directory>
20+
</include>
21+
</coverage>
1422
</phpunit>

src/BootstrapAsset.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
*/
1818
class BootstrapAsset extends AssetBundle
1919
{
20-
public $sourcePath = '@bower/bootstrap/dist';
20+
public $sourcePath = '@npm/bootstrap3/dist';
2121
public $css = [
2222
'css/bootstrap.css',
2323
];

src/BootstrapPluginAsset.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
*/
1818
class BootstrapPluginAsset extends AssetBundle
1919
{
20-
public $sourcePath = '@bower/bootstrap/dist';
20+
public $sourcePath = '@npm/bootstrap3/dist';
2121
public $js = [
2222
'js/bootstrap.js',
2323
];

src/BootstrapThemeAsset.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
*/
1818
class BootstrapThemeAsset extends AssetBundle
1919
{
20-
public $sourcePath = '@bower/bootstrap/dist';
20+
public $sourcePath = '@npm/bootstrap3/dist';
2121
public $css = [
2222
'css/bootstrap-theme.css',
2323
];

0 commit comments

Comments
 (0)