Skip to content

Commit 473791c

Browse files
Update PHP and Yii2 versions, enhance README.md, and refine asset management. (#86)
1 parent 1804735 commit 473791c

38 files changed

+224
-152
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ on:
66
- 'CHANGELOG.md'
77
- '.gitignore'
88
- '.gitattributes'
9-
- 'infection.json.dist'
10-
- 'psalm.xml'
119

1210
push:
1311
paths-ignore:
@@ -16,8 +14,6 @@ on:
1614
- 'CHANGELOG.md'
1715
- '.gitignore'
1816
- '.gitattributes'
19-
- 'infection.json.dist'
20-
- 'psalm.xml'
2117

2218
name: build
2319

@@ -27,10 +23,8 @@ jobs:
2723
secrets:
2824
AUTH_TOKEN: ${{ secrets.AUTH_TOKEN }}
2925
with:
30-
composer-command: |
31-
composer require yiisoft/yii2:^2.2.x-dev --prefer-dist --no-progress --no-interaction --no-scripts --ansi
3226
extensions: gd, intl
3327
os: >-
3428
['ubuntu-latest', 'windows-latest']
3529
php: >-
36-
['8.1', '8.2', '8.3']
30+
['8.2', '8.3', '8.4']

.github/workflows/compatibility.yml

Lines changed: 0 additions & 34 deletions
This file was deleted.

.github/workflows/dependency-check.yml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@ on:
66
- 'CHANGELOG.md'
77
- '.gitignore'
88
- '.gitattributes'
9-
- 'infection.json.dist'
10-
- 'phpunit.xml.dist'
11-
- 'psalm.xml'
129

1310
push:
1411
paths-ignore:
@@ -17,9 +14,6 @@ on:
1714
- 'CHANGELOG.md'
1815
- '.gitignore'
1916
- '.gitattributes'
20-
- 'infection.json.dist'
21-
- 'phpunit.xml.dist'
22-
- 'psalm.xml'
2317

2418
name: dependency-check
2519

@@ -32,4 +26,4 @@ jobs:
3226
os: >-
3327
['ubuntu-latest']
3428
php: >-
35-
['8.1']
29+
['8.2']

.github/workflows/ecs.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
on:
2+
pull_request:
3+
paths-ignore:
4+
- 'docs/**'
5+
- 'README.md'
6+
- 'CHANGELOG.md'
7+
- '.gitignore'
8+
- '.gitattributes'
9+
10+
push:
11+
paths-ignore:
12+
- 'docs/**'
13+
- 'README.md'
14+
- 'CHANGELOG.md'
15+
- '.gitignore'
16+
- '.gitattributes'
17+
18+
name: ecs
19+
20+
jobs:
21+
easy-coding-standard:
22+
uses: php-forge/actions/.github/workflows/ecs.yml@main
23+
with:
24+
extensions: mbstring
25+
os: >-
26+
['ubuntu-latest']
27+
php: >-
28+
['8.2']

.github/workflows/static.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ on:
66
- 'CHANGELOG.md'
77
- '.gitignore'
88
- '.gitattributes'
9-
- 'infection.json.dist'
10-
- 'phpunit.xml.dist'
119

1210
push:
1311
paths-ignore:
@@ -16,8 +14,6 @@ on:
1614
- 'CHANGELOG.md'
1715
- '.gitignore'
1816
- '.gitattributes'
19-
- 'infection.json.dist'
20-
- 'phpunit.xml.dist'
2117

2218
name: static analysis
2319

@@ -30,4 +26,4 @@ jobs:
3026
os: >-
3127
['ubuntu-latest']
3228
php: >-
33-
['8.1']
29+
['8.2']

README.md

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,11 @@
66
</p>
77

88
<p align="center">
9-
<a href="https://www.php.net/releases/8.1/en.php" target="_blank">
10-
<img src="https://img.shields.io/badge/PHP-%3E%3D8.1-787CB5" alt="php-version">
9+
<a href="https://www.php.net/releases/8.2/en.php" target="_blank">
10+
<img src="https://img.shields.io/badge/PHP-%3E%3D8.2-787CB5" alt="php-version">
11+
</a>
12+
<a href="https://github.com/yiisoft/yii2/tree/22.0" target="_blank">
13+
<img src="https://img.shields.io/badge/Yii2%20-22-blue" alt="Yii2 version">
1114
</a>
1215
<a href="https://github.com/yii2-extensions/app-basic/actions/workflows/build.yml" target="_blank">
1316
<img src="https://github.com/yii2-extensions/app-basic/actions/workflows/build.yml/badge.svg" alt="PHPUnit">
@@ -17,12 +20,6 @@
1720
</a>
1821
<a href="https://github.com/yii2-extensions/app-basic/actions/workflows/static.yml" target="_blank">
1922
<img src="https://github.com/yii2-extensions/app-basic/actions/workflows/static.yml/badge.svg" alt="PHPStan">
20-
</a>
21-
<a href="https://github.com/yii2-extensions/app-basic/actions/workflows/static.yml" target="_blank">
22-
<img src="https://img.shields.io/badge/PHPStan%20level-5-blue" alt="PHPStan level">
23-
</a>
24-
<a href="https://github.styleci.io/repos/698621511?branch=main" target="_blank">
25-
<img src="https://github.styleci.io/repos/698621511/shield?branch=main" alt="Code style">
2623
</a>
2724
</p>
2825

@@ -150,6 +147,11 @@ Root directory
150147
./yii message config/messages.php
151148
```
152149

150+
## Quality code
151+
152+
[![phpstan-level](https://img.shields.io/badge/PHPStan%20level-5-blue)](https://github.com/yii2-extensions/app-basic/actions/workflows/static.yml)
153+
[![StyleCI](https://github.styleci.io/repos/698621511/shield?branch=main)](https://github.styleci.io/repos/698621511?branch=main)
154+
153155
## Tests
154156

155157
~~~
@@ -160,11 +162,6 @@ $ composer update --prefer-dist -vvv
160162
$ vendor/bin/codecept run --coverage-xml
161163
~~~
162164

163-
## Support versions Yii2
164-
165-
[![Yii20](https://img.shields.io/badge/Yii2%20version-2.0-blue)](https://github.com/yiisoft/yii2/tree/2.0.49.3)
166-
[![Yii22](https://img.shields.io/badge/Yii2%20version-2.2-blue)](https://github.com/yiisoft/yii2/tree/2.2)
167-
168165
## Our social networks
169166

170167
[![Twitter](https://img.shields.io/badge/twitter-follow-1DA1F2?logo=twitter&logoColor=1DA1F2&labelColor=555555?style=flat)](https://twitter.com/Terabytesoftw)

composer.json

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,19 @@
1212
"minimum-stability": "dev",
1313
"prefer-stable": true,
1414
"require": {
15-
"php": ">=8.1",
16-
"npm-asset/flag-icons": "^7.1",
17-
"npm-asset/fortawesome--fontawesome-free": "^6.5",
15+
"php": ">=8.2",
16+
"php-forge/foxy": "^0.1",
1817
"sjaakp/yii2-icon": "^1.0",
1918
"ui-awesome/html": "^0.3",
2019
"ui-awesome/html-component-bootstrap5": "^1.0@dev",
2120
"ui-awesome/html-core":"^0.1",
2221
"ui-awesome/html-helper":"^0.2",
2322
"ui-awesome/html-svg":"^0.2",
24-
"yii2-extensions/asset-bootstrap5": "^0.1",
25-
"yii2-extensions/bootstrap5": "^0.1",
2623
"yii2-extensions/localeurls": "dev-main",
2724
"yiisoft/config": "^1.4",
28-
"yiisoft/yii2": "^2.0.49 || ^2.2",
29-
"yiisoft/yii2-symfonymailer": "^4.0"
25+
"yiisoft/yii2": "22.0.x-dev",
26+
"yiisoft/yii2-bootstrap5": "22.x-dev",
27+
"yiisoft/yii2-symfonymailer": "22.x-dev"
3028
},
3129
"require-dev": {
3230
"codeception/c3": "^2.8",
@@ -37,11 +35,13 @@
3735
"codeception/module-yii2": "^1.1",
3836
"codeception/verify": "^3.0",
3937
"maglnet/composer-require-checker": "^4.6",
38+
"phpstan/phpstan": "^2.1",
39+
"rector/rector": "^2.0",
4040
"symfony/browser-kit": "^6.3",
4141
"symfony/process": "^6.3",
42-
"yii2-extensions/debug": "dev-main",
43-
"yii2-extensions/gii": "dev-main",
44-
"yii2-extensions/phpstan": "^0.1"
42+
"symplify/easy-coding-standard": "^12.3",
43+
"yiisoft/yii2-debug": "22.x-dev",
44+
"yiisoft/yii2-gii": "22.x-dev"
4545
},
4646
"autoload": {
4747
"psr-4": {
@@ -59,18 +59,20 @@
5959
},
6060
"config-plugin-file": "/config/config-plugin.php"
6161
},
62-
"repositories": [
63-
{
64-
"type": "composer",
65-
"url": "https://asset-packagist.org"
66-
}
67-
],
6862
"config": {
6963
"allow-plugins": {
7064
"codeception/c3": true,
7165
"yiisoft/yii2-composer": true,
7266
"composer/installers": true,
73-
"yiisoft/config": true
67+
"yiisoft/config": true,
68+
"php-forge/foxy": true
7469
}
70+
},
71+
"scripts": {
72+
"check-dependencies": "./vendor/bin/composer-require-checker check",
73+
"ecs": "./vendor/bin/ecs --fix",
74+
"rector": "./vendor/bin/rector process src",
75+
"static": "./vendor/bin/phpstan analyse src --memory-limit=512M",
76+
"tests": "./vendor/bin/codecept run"
7577
}
7678
}

config/config-plugin.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,6 @@
1111
],
1212
'web' => [
1313
'$common',
14-
'$yii2-bootstrap5',
15-
'$yii2-debug',
16-
'$yii2-gii',
17-
'$yii2-localeurls',
1814
'web/*.php',
1915
],
2016
'params' => 'params.php',

config/params-web.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@
88
return [
99
// web application settings shared
1010
'common.aliases' => [
11-
'@bower' => '@vendor/bower-asset',
12-
'@npm' => '@vendor/npm-asset',
11+
'@npm' => '@app/node_modules',
1312
'@public' => '@app/public',
1413
'@web' => '@public',
1514
'@runtime' => '@public/runtime',
@@ -60,7 +59,7 @@
6059
],
6160
],
6261
'app.menu.islogged' => [],
63-
'icons' => '@npm/fortawesome--fontawesome-free/svgs/{family}/{name}.svg',
62+
'icons' => '@npm/@fortawesome/fontawesome-free/svgs/{family}/{name}.svg',
6463
],
6564
'web.request.cookieValidationKey' => 'your-cookie-validation-key',
6665
'web.request.enableCsrfValidation' => true,

config/web/components.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
declare(strict_types=1);
44

5+
use yii2\extensions\localeurls\UrlLanguageManager;
56
use yii\i18n\PhpMessageSource;
6-
use yii\web\UrlManager;
77

88
/**
99
* @var array $params
@@ -30,7 +30,8 @@
3030
'enableCsrfValidation' => $params['web.request.enableCsrfValidation'],
3131
],
3232
'urlManager' => [
33-
'class' => $params['yii2.urlManager.class'] ?? UrlManager::class,
33+
'class' => UrlLanguageManager::class,
34+
'languages' => $params['yii2.localeurls.languages'],
3435
'enablePrettyUrl' => $params['web.urlManager.enablePrettyUrl'],
3536
'showScriptName' => $params['web.urlManager.showScriptName'],
3637
],

0 commit comments

Comments
 (0)