Skip to content

Commit

Permalink
Bump phpstan packages (#225)
Browse files Browse the repository at this point in the history
* bump deps

* add type perfect

* fix few static errors
  • Loading branch information
TomasVotruba authored Jun 23, 2024
1 parent a16ded4 commit b1ee7a6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 25 deletions.
7 changes: 3 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,12 @@
"phpstan/extension-installer": "^1.3",
"phpstan/phpstan": "^1.10",
"phpstan/phpstan-webmozart-assert": "^1.2",
"phpunit/phpunit": "^10.3",
"rector/phpstan-rules": "^0.7.4",
"rector/rector-generator": "^0.7.3",
"phpunit/phpunit": "^10.5",
"rector/rector-src": "dev-main",
"rector/type-perfect": "^0.1.6",
"symplify/easy-coding-standard": "^12.0",
"symplify/phpstan-extensions": "^11.3",
"symplify/phpstan-rules": "^12.4",
"symplify/phpstan-rules": "^13.0",
"symplify/rule-doc-generator": "^12.0",
"symplify/vendor-patches": "^11.2",
"tomasvotruba/class-leak": "^0.2.13",
Expand Down
29 changes: 8 additions & 21 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
includes:
- vendor/symplify/phpstan-rules/config/symplify-rules.neon
- vendor/symplify/phpstan-rules/config/rector-rules.neon

parameters:
level: 8
Expand All @@ -22,6 +23,13 @@ parameters:
- '*/Fixture/*'
- '*/Source/*'

# see https://github.com/rectorphp/type-perfect/
type_perfect:
no_mixed: true
null_over_false: true
narrow_param: true
narrow_return: true

ignoreErrors:
# php enum value minus
- '#Parameter \#1 \$phpVersion of method Rector\\Config\\RectorConfig\:\:phpVersion\(\) expects (.*?), (.*?) given#'
Expand All @@ -31,27 +39,6 @@ parameters:

- '#Calling PHPStan\\Reflection\\Native\\NativeFunctionReflection\:\:getName\(\) is not covered by backward compatibility promise\. The method might change in a minor PHPStan version#'

-
message: '#New objects with "\$functionLikeReflection" name are overridden\. This can lead to unwanted bugs, please pick a different name to avoid it#'
path: rules/DowngradePhp80/NodeAnalyzer/UnnamedArgumentResolver.php

# nullable correction type
-
message: '#New objects with "\$parentReturnTypeNode" name are overridden\. This can lead to unwanted bugs, please pick a different name to avoid it#'
path: rules/DowngradePhp74/Rector/ClassMethod/DowngradeCovariantReturnTypeRector.php

# cleaning expr
-
message: '#New objects with "\$bitwiseOr" name are overridden\. This can lead to unwanted bugs, please pick a different name to avoid it#'
path: rules/DowngradePhp72/NodeManipulator/BitwiseFlagCleaner.php

- '#Method "decorateReturnWithSpecificType\(\)" returns bool type, so the name should start with is/has/was#'
- '#Method "decorateParamWithSpecificType\(\)" returns bool type, so the name should start with is/has/was#'

-
message: '#New objects with "\$returnType" name are overridden\. This can lead to unwanted bugs, please pick a different name to avoid it#'
path: src/PhpDocDecorator/PhpDocFromTypeDeclarationDecorator.php

- '#Parameter \#3 \$stmt of method Rector\\DowngradePhp72\\Rector\\FuncCall\\DowngradePregUnmatchedAsNullConstantRector\:\:processReplace\(\) expects PhpParser\\Node\\Stmt, PhpParser\\Node given#'

- '#(.*?)\:\:refactor\(\) should return array<PhpParser\\Node\\Stmt>\|PhpParser\\Node\\Stmt\\ClassConst\|null but returns array<PhpParser\\Node\\Stmt>\|PhpParser\\Node\\Stmt\|null#'
Expand Down

0 comments on commit b1ee7a6

Please sign in to comment.