Skip to content

Commit b9db74c

Browse files
authored
Add compatibility with phpstan 1.x (#50)
1 parent 1dc56b6 commit b9db74c

17 files changed

+498
-432
lines changed

.github/workflows/php.yml

+29-3
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,27 @@ on: [push,pull_request]
44

55
jobs:
66
build:
7-
7+
name: "Tests (PHP: ${{ matrix.php-version}}, deps: ${{ matrix.deps }})"
88
runs-on: ubuntu-latest
9+
strategy:
10+
fail-fast: false
11+
matrix:
12+
php-version: ['7.2', '7.3', '7.4', '8.0']
13+
deps: ['lowest', 'locked', 'highest']
14+
exclude:
15+
- php-version: '7.2'
16+
deps: 'locked'
17+
- php-version: '7.3'
18+
deps: 'locked'
919

1020
steps:
21+
- name: Setup PHP
22+
uses: shivammathur/setup-php@v2
23+
with:
24+
php-version: "${{ matrix.php-version }}"
25+
ini-values: "memory_limit=-1"
26+
coverage: none
27+
1128
- uses: actions/checkout@v1
1229

1330
- name: Get Composer Cache Directory
@@ -25,8 +42,17 @@ jobs:
2542
- name: Validate composer.json and composer.lock
2643
run: composer validate
2744

28-
- name: Install dependencies
29-
run: composer install
45+
- name: "Install dependencies (lowest)"
46+
if: ${{ matrix.deps == 'lowest' }}
47+
run: "composer update --prefer-lowest --no-interaction --no-suggest"
48+
49+
- name: "Install dependencies (locked)"
50+
if: ${{ matrix.deps == 'locked' }}
51+
run: "composer install --no-interaction --no-suggest"
52+
53+
- name: "Install dependencies (highest)"
54+
if: ${{ matrix.deps == 'highest' }}
55+
run: "composer update --no-interaction --no-suggest"
3056

3157
- name: Run test suite
3258
run: composer check

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
1212
* **Fixed** for any bug fixes.
1313
* **Security** in case of vulnerabilities.
1414

15+
## [0.8.0] 2022-01-10
16+
### Added
17+
* Initial phpstan 1.x support
18+
1519
## [0.7.6] 2021-08-10
1620
### Added
1721
* Compatibility with yii 2.0.43 (#45)

README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515
## Compatibility
1616

1717
| PHPStan version | Yii2 extension version |
18-
| --------------- | ---------------------- |
18+
|-----------------|------------------------|
19+
| 1.x | 0.8.x |
1920
| 0.12 | 0.7.x |
2021
| 0.11 | 0.5.x - 0.6.x |
2122
| 0.10.3 | 0.4.x |

composer.json

+12-7
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@
1616
"require": {
1717
"php": "^7.2|^8.0",
1818
"nikic/php-parser": "^4.1.0",
19-
"phpstan/phpstan": "^0.12.91"
19+
"phpstan/phpstan": "^1.0"
2020
},
2121
"require-dev": {
2222
"friendsofphp/php-cs-fixer": "^3.1",
2323
"phpunit/phpunit": "^8.0",
2424
"yiisoft/yii2": "^2.0.42",
25-
"phpstan/phpstan-phpunit": "^0.12"
25+
"phpstan/phpstan-phpunit": "^1.0"
2626
},
2727
"autoload": {
2828
"psr-4": {
@@ -40,15 +40,20 @@
4040
"@stan",
4141
"@tests"
4242
],
43-
"check-cs": "php-cs-fixer fix --dry-run --diff",
44-
"fix-cs": "php-cs-fixer fix",
45-
"stan": "phpstan analyse -l max -c ./phpstan.neon ./src ./tests",
46-
"tests": "phpunit"
43+
"check-cs": "@php php-cs-fixer fix --dry-run --diff",
44+
"fix-cs": "@php php-cs-fixer fix",
45+
"stan": "@php phpstan analyse -l max -c ./phpstan.neon ./src ./tests",
46+
"tests": "@php phpunit"
4747
},
4848
"repositories": [
4949
{
5050
"type": "composer",
5151
"url": "https://asset-packagist.org"
5252
}
53-
]
53+
],
54+
"config": {
55+
"allow-plugins": {
56+
"yiisoft/yii2-composer": true
57+
}
58+
}
5459
}

0 commit comments

Comments
 (0)