Skip to content

Commit 54ac328

Browse files
authored
PHP 8.1 + Minor refactoring (#106)
1 parent 2ce2c66 commit 54ac328

30 files changed

+232
-309
lines changed

.github/workflows/bc.yml

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,25 @@
11
on:
2-
- pull_request
3-
- push
2+
pull_request:
3+
paths-ignore:
4+
- 'docs/**'
5+
- 'README.md'
6+
- 'CHANGELOG.md'
7+
- '.gitignore'
8+
- '.gitattributes'
9+
- 'infection.json.dist'
10+
- 'phpunit.xml.dist'
11+
- 'psalm.xml'
12+
push:
13+
branches: ['master']
14+
paths-ignore:
15+
- 'docs/**'
16+
- 'README.md'
17+
- 'CHANGELOG.md'
18+
- '.gitignore'
19+
- '.gitattributes'
20+
- 'infection.json.dist'
21+
- 'phpunit.xml.dist'
22+
- 'psalm.xml'
423

524
name: backwards compatibility
625

@@ -11,4 +30,4 @@ jobs:
1130
os: >-
1231
['ubuntu-latest']
1332
php: >-
14-
['8.0']
33+
['8.1']

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,4 @@ jobs:
3030
os: >-
3131
['ubuntu-latest', 'windows-latest']
3232
php: >-
33-
['8.0', '8.1', '8.2', '8.3']
33+
['8.1', '8.2', '8.3']

.github/workflows/composer-require-checker.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,4 @@ jobs:
3232
os: >-
3333
['ubuntu-latest']
3434
php: >-
35-
['8.0', '8.1', '8.2', '8.3']
35+
['8.1', '8.2', '8.3']

.github/workflows/rector.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
on:
2-
pull_request:
2+
pull_request_target:
33
paths-ignore:
44
- 'docs/**'
55
- 'README.md'
@@ -17,6 +17,7 @@ jobs:
1717
secrets:
1818
token: ${{ secrets.YIISOFT_GITHUB_TOKEN }}
1919
with:
20+
repository: ${{ github.event.pull_request.head.repo.full_name }}
2021
os: >-
2122
['ubuntu-latest']
2223
php: >-

.github/workflows/static.yml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,3 @@ jobs:
3131
['ubuntu-latest']
3232
php: >-
3333
['8.1', '8.2', '8.3']
34-
psalm80:
35-
uses: yiisoft/actions/.github/workflows/psalm.yml@master
36-
with:
37-
psalm-config: psalm80.xml
38-
os: >-
39-
['ubuntu-latest']
40-
php: >-
41-
['8.0']

.gitignore

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,7 @@ Thumbs.db
2222
# composer itself is not needed
2323
composer.phar
2424

25-
# phpunit itself is not needed
26-
phpunit.phar
27-
# local phpunit config
25+
# PHPUnit
26+
/phpunit.phar
2827
/phpunit.xml
29-
# phpunit cache
30-
.phpunit.result.cache
28+
/.phpunit.cache

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22

33
## 3.3.2 under development
44

5-
- no changes in this release.
5+
- Chg #106: Bump minimal required PHP version to 8.1 (@vjik)
6+
- Enh #106: Minor performance optimization: use FQN for PHP functions, remove unnecessary conditions (@vjik)
7+
- Enh #106: Mark readonly properties (@vjik)
68

79
## 3.3.1 December 16, 2024
810

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ The following are provided:
2626

2727
## Requirements
2828

29-
- PHP 8.0 or higher.
29+
- PHP 8.1 or higher.
3030

3131
## Installation
3232

composer.json

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,16 @@
2626
}
2727
],
2828
"require": {
29-
"php": "^8.0",
30-
"psr/container": "^1.0|^2.0"
29+
"php": "^8.1",
30+
"psr/container": "^1.0 || ^2.0"
3131
},
3232
"require-dev": {
33-
"maglnet/composer-require-checker": "^4.2",
34-
"phpunit/phpunit": "^9.5",
35-
"rector/rector": "^1.0.0",
36-
"roave/infection-static-analysis-plugin": "^1.18",
37-
"spatie/phpunit-watcher": "^1.23",
38-
"vimeo/psalm": "^4.30|^5.21",
33+
"maglnet/composer-require-checker": "^4.7.1",
34+
"phpunit/phpunit": "^10.5.45",
35+
"rector/rector": "^2.0.9",
36+
"roave/infection-static-analysis-plugin": "^1.35",
37+
"spatie/phpunit-watcher": "^1.24",
38+
"vimeo/psalm": "^5.26.1 || ^6.7.1",
3939
"yiisoft/test-support": "^1.4"
4040
},
4141
"autoload": {
@@ -50,6 +50,7 @@
5050
},
5151
"config": {
5252
"sort-packages": true,
53+
"bump-after-update": "dev",
5354
"allow-plugins": {
5455
"infection/extension-installer": true,
5556
"composer/package-versions-deprecated": true

phpunit.xml.dist

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,32 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
3-
<phpunit bootstrap="vendor/autoload.php"
4-
colors="true"
5-
verbose="true"
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
4+
bootstrap="vendor/autoload.php"
5+
cacheDirectory=".phpunit.cache"
6+
requireCoverageMetadata="false"
7+
beStrictAboutCoverageMetadata="true"
8+
beStrictAboutOutputDuringTests="true"
9+
executionOrder="random"
610
failOnRisky="true"
711
failOnWarning="true"
8-
convertErrorsToExceptions="true"
9-
convertNoticesToExceptions="true"
10-
convertWarningsToExceptions="true"
1112
stopOnFailure="false"
12-
executionOrder="random"
13-
resolveDependencies="true">
13+
colors="true"
14+
displayDetailsOnPhpunitDeprecations="true"
15+
>
1416
<php>
1517
<ini name="error_reporting" value="-1"/>
1618
</php>
1719

1820
<testsuites>
1921
<testsuite name="Yii Definitions tests">
2022
<directory>./tests/Unit</directory>
21-
<directory phpVersion="8.1" phpVersionOperator=">=">./tests/Php8_1</directory>
2223
<directory phpVersion="8.2" phpVersionOperator=">=">./tests/Php8_2</directory>
2324
</testsuite>
2425
</testsuites>
2526

26-
<coverage>
27+
<source>
2728
<include>
28-
<directory>./src</directory>
29+
<directory suffix=".php">./src</directory>
2930
</include>
30-
</coverage>
31+
</source>
3132
</phpunit>

0 commit comments

Comments
 (0)