Skip to content

Commit b1ee7a6

Browse files
authored
Bump phpstan packages (#225)
* bump deps * add type perfect * fix few static errors
1 parent a16ded4 commit b1ee7a6

File tree

2 files changed

+11
-25
lines changed

2 files changed

+11
-25
lines changed

composer.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,12 @@
1010
"phpstan/extension-installer": "^1.3",
1111
"phpstan/phpstan": "^1.10",
1212
"phpstan/phpstan-webmozart-assert": "^1.2",
13-
"phpunit/phpunit": "^10.3",
14-
"rector/phpstan-rules": "^0.7.4",
15-
"rector/rector-generator": "^0.7.3",
13+
"phpunit/phpunit": "^10.5",
1614
"rector/rector-src": "dev-main",
15+
"rector/type-perfect": "^0.1.6",
1716
"symplify/easy-coding-standard": "^12.0",
1817
"symplify/phpstan-extensions": "^11.3",
19-
"symplify/phpstan-rules": "^12.4",
18+
"symplify/phpstan-rules": "^13.0",
2019
"symplify/rule-doc-generator": "^12.0",
2120
"symplify/vendor-patches": "^11.2",
2221
"tomasvotruba/class-leak": "^0.2.13",

phpstan.neon

Lines changed: 8 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
includes:
22
- vendor/symplify/phpstan-rules/config/symplify-rules.neon
3+
- vendor/symplify/phpstan-rules/config/rector-rules.neon
34

45
parameters:
56
level: 8
@@ -22,6 +23,13 @@ parameters:
2223
- '*/Fixture/*'
2324
- '*/Source/*'
2425

26+
# see https://github.com/rectorphp/type-perfect/
27+
type_perfect:
28+
no_mixed: true
29+
null_over_false: true
30+
narrow_param: true
31+
narrow_return: true
32+
2533
ignoreErrors:
2634
# php enum value minus
2735
- '#Parameter \#1 \$phpVersion of method Rector\\Config\\RectorConfig\:\:phpVersion\(\) expects (.*?), (.*?) given#'
@@ -31,27 +39,6 @@ parameters:
3139

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

34-
-
35-
message: '#New objects with "\$functionLikeReflection" name are overridden\. This can lead to unwanted bugs, please pick a different name to avoid it#'
36-
path: rules/DowngradePhp80/NodeAnalyzer/UnnamedArgumentResolver.php
37-
38-
# nullable correction type
39-
-
40-
message: '#New objects with "\$parentReturnTypeNode" name are overridden\. This can lead to unwanted bugs, please pick a different name to avoid it#'
41-
path: rules/DowngradePhp74/Rector/ClassMethod/DowngradeCovariantReturnTypeRector.php
42-
43-
# cleaning expr
44-
-
45-
message: '#New objects with "\$bitwiseOr" name are overridden\. This can lead to unwanted bugs, please pick a different name to avoid it#'
46-
path: rules/DowngradePhp72/NodeManipulator/BitwiseFlagCleaner.php
47-
48-
- '#Method "decorateReturnWithSpecificType\(\)" returns bool type, so the name should start with is/has/was#'
49-
- '#Method "decorateParamWithSpecificType\(\)" returns bool type, so the name should start with is/has/was#'
50-
51-
-
52-
message: '#New objects with "\$returnType" name are overridden\. This can lead to unwanted bugs, please pick a different name to avoid it#'
53-
path: src/PhpDocDecorator/PhpDocFromTypeDeclarationDecorator.php
54-
5542
- '#Parameter \#3 \$stmt of method Rector\\DowngradePhp72\\Rector\\FuncCall\\DowngradePregUnmatchedAsNullConstantRector\:\:processReplace\(\) expects PhpParser\\Node\\Stmt, PhpParser\\Node given#'
5643

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

0 commit comments

Comments
 (0)