Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add compatibility with phpstan 1.x #50

Merged
merged 4 commits into from
Jan 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can also release this as 1.0.0 (I saw other plugins did that too)

| 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