Skip to content

Commit

Permalink
Add compatibility with phpstan 1.x (#50)
Browse files Browse the repository at this point in the history
  • Loading branch information
marmichalski authored Jan 10, 2022
1 parent 1dc56b6 commit b9db74c
Show file tree
Hide file tree
Showing 17 changed files with 498 additions and 432 deletions.
32 changes: 29 additions & 3 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,27 @@ on: [push,pull_request]

jobs:
build:

name: "Tests (PHP: ${{ matrix.php-version}}, deps: ${{ matrix.deps }})"
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php-version: ['7.2', '7.3', '7.4', '8.0']
deps: ['lowest', 'locked', 'highest']
exclude:
- php-version: '7.2'
deps: 'locked'
- php-version: '7.3'
deps: 'locked'

steps:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: "${{ matrix.php-version }}"
ini-values: "memory_limit=-1"
coverage: none

- uses: actions/checkout@v1

- name: Get Composer Cache Directory
Expand All @@ -25,8 +42,17 @@ jobs:
- name: Validate composer.json and composer.lock
run: composer validate

- name: Install dependencies
run: composer install
- name: "Install dependencies (lowest)"
if: ${{ matrix.deps == 'lowest' }}
run: "composer update --prefer-lowest --no-interaction --no-suggest"

- name: "Install dependencies (locked)"
if: ${{ matrix.deps == 'locked' }}
run: "composer install --no-interaction --no-suggest"

- name: "Install dependencies (highest)"
if: ${{ matrix.deps == 'highest' }}
run: "composer update --no-interaction --no-suggest"

- name: Run test suite
run: composer check
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
* **Fixed** for any bug fixes.
* **Security** in case of vulnerabilities.

## [0.8.0] 2022-01-10
### Added
* Initial phpstan 1.x support

## [0.7.6] 2021-08-10
### Added
* Compatibility with yii 2.0.43 (#45)
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
## Compatibility

| PHPStan version | Yii2 extension version |
| --------------- | ---------------------- |
|-----------------|------------------------|
| 1.x | 0.8.x |
| 0.12 | 0.7.x |
| 0.11 | 0.5.x - 0.6.x |
| 0.10.3 | 0.4.x |
Expand Down
19 changes: 12 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@
"require": {
"php": "^7.2|^8.0",
"nikic/php-parser": "^4.1.0",
"phpstan/phpstan": "^0.12.91"
"phpstan/phpstan": "^1.0"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^3.1",
"phpunit/phpunit": "^8.0",
"yiisoft/yii2": "^2.0.42",
"phpstan/phpstan-phpunit": "^0.12"
"phpstan/phpstan-phpunit": "^1.0"
},
"autoload": {
"psr-4": {
Expand All @@ -40,15 +40,20 @@
"@stan",
"@tests"
],
"check-cs": "php-cs-fixer fix --dry-run --diff",
"fix-cs": "php-cs-fixer fix",
"stan": "phpstan analyse -l max -c ./phpstan.neon ./src ./tests",
"tests": "phpunit"
"check-cs": "@php php-cs-fixer fix --dry-run --diff",
"fix-cs": "@php php-cs-fixer fix",
"stan": "@php phpstan analyse -l max -c ./phpstan.neon ./src ./tests",
"tests": "@php phpunit"
},
"repositories": [
{
"type": "composer",
"url": "https://asset-packagist.org"
}
]
],
"config": {
"allow-plugins": {
"yiisoft/yii2-composer": true
}
}
}
Loading

0 comments on commit b9db74c

Please sign in to comment.