Skip to content

Commit

Permalink
Use less-old phpstan
Browse files Browse the repository at this point in the history
phpstan 1.5 is very out of date and the API for defining rules is incompatible with the current API.

tests are currently failing, but they're failing upstream and they should pass once all the other PRs are merged

PHPStan 2.0 was released a few days ago, but other parts of our dependency tree are locked to "1.X", so for now I'm just updating to "most recent 1.X" and we can look at 2.0 after the rest is stable.
  • Loading branch information
shish authored and staabm committed Nov 28, 2024
1 parent cf04aca commit 4b73aa4
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 7 deletions.
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -105,15 +105,15 @@
"php": "^8.0"
},
"require-dev": {
"phpstan/phpstan": "^1.5",
"phpstan/phpstan": "^1",
"thecodingmachine/phpstan-strict-rules": "^1.0",
"squizlabs/php_codesniffer": "^3.2",
"phpunit/phpunit": "^10"
},
"scripts": {
"test": "phpunit",
"phpstan": "phpstan analyse lib -c phpstan.neon --level=max --no-progress -vvv",
"phpstan": "phpstan analyse",
"cs-fix": "phpcbf",
"cs-check": "phpcs"
}
}
}
4 changes: 2 additions & 2 deletions generator/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@
"thecodingmachine/phpstan-strict-rules": "^1.0",
"squizlabs/php_codesniffer": "^3.2",
"php-coveralls/php-coveralls": "^2.1",
"phpstan/phpstan": "^1.5"
"phpstan/phpstan": "^1"
},
"scripts": {
"test": "vendor/bin/phpunit",
"phpstan": "phpstan analyse src -c phpstan.neon --level=max --no-progress -vvv",
"phpstan": "phpstan analyse",
"cs-fix": "phpcbf",
"cs-check": "phpcs"
}
Expand Down
6 changes: 5 additions & 1 deletion generator/phpstan.neon
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
parameters:
paths:
- ./src
# The level 9 is the highest level (with check for mixed type)
level: 8
ignoreErrors:
includes:
- vendor/thecodingmachine/phpstan-strict-rules/phpstan-strict-rules.neon
- vendor/thecodingmachine/phpstan-strict-rules/phpstan-strict-rules.neon
6 changes: 5 additions & 1 deletion phpstan.neon
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
parameters:
paths:
- ./lib
# The level 9 is the highest level (with check for mixed type)
level: 8
ignoreErrors:
# A lot of functions are in extensions so it is ok not to find those
includes:
- vendor/thecodingmachine/phpstan-strict-rules/phpstan-strict-rules.neon
- vendor/thecodingmachine/phpstan-strict-rules/phpstan-strict-rules.neon

0 comments on commit 4b73aa4

Please sign in to comment.