-
Notifications
You must be signed in to change notification settings - Fork 112
Expand file tree
/
Copy pathphpstan.neon
More file actions
87 lines (66 loc) · 2.97 KB
/
phpstan.neon
File metadata and controls
87 lines (66 loc) · 2.97 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
includes:
- vendor/symplify/phpstan-rules/config/symplify-rules.neon
- vendor/symplify/phpstan-rules/config/rector-rules.neon
rules:
- Symplify\PHPStanRules\Rules\StringFileAbsolutePathExistsRule
parameters:
level: 8
errorFormat: symplify
# see https://phpstan.org/writing-php-code/phpdoc-types#global-type-aliases
typeAliases:
StmtsAware: \PhpParser\Node\Stmt\Block | \PhpParser\Node\Expr\Closure | \PhpParser\Node\Stmt\Case_ | \PhpParser\Node\Stmt\Catch_ | \PhpParser\Node\Stmt\ClassMethod | \PhpParser\Node\Stmt\Do_ | \PhpParser\Node\Stmt\Else_ | \PhpParser\Node\Stmt\ElseIf_ | \PhpParser\Node\Stmt\Finally_ | \PhpParser\Node\Stmt\For_ | \PhpParser\Node\Stmt\Foreach_ | \PhpParser\Node\Stmt\Function_ | \PhpParser\Node\Stmt\If_ | \PhpParser\Node\Stmt\Namespace_ | \PhpParser\Node\Stmt\TryCatch | \PhpParser\Node\Stmt\While_ | \Rector\PhpParser\Node\FileNode
# reportUnmatchedIgnoredErrors: false
treatPhpDocTypesAsCertain: false
paths:
- config
- src
- tests
- rules
- rules-tests
# https://github.com/rectorphp/type-perfect/
type_perfect:
no_mixed: true
null_over_false: true
narrow_param: true
narrow_return: true
unused_public:
constants: true
methods: true
properties: true
scanDirectories:
- stubs
excludePaths:
- */Source/*
- */Fixture/*
- */Fixture*/*
ignoreErrors:
# pointless check
- '#expects class-string, string given#'
# false positive
- '#but class PhpParser\\Node\\Stmt\\Expression is not generic#'
# more advanced usage, but not always working
# see https://github.com/rectorphp/rector-src/actions/runs/11798721617/job/32865546672?pr=6422#step:5:110
- '#Doing instanceof PHPStan\\Type\\.+ is error\-prone and deprecated#'
# phpstan instanceof
- identifier: argument.type
- identifier: assign.propertyType
# false postitive
-
identifier: typePerfect.narrowPublicClassMethodParamType
paths:
- src/NodeAnalyzer/SymfonyPhpClosureDetector.php
- rules/Configs/NodeDecorator/ServiceDefaultsCallClosureDecorator.php
- '#Parameter 1 should use "PHPStan\\BetterReflection\\Reflection\\Adapter\\ReflectionMethod" type as the only type passed to this method#'
# in tests
-
message: '#Fetching deprecated class constant SYMFONY_(.*?) of class Rector\\Symfony\\Set\\SymfonySetList#'
paths:
- tests
- config/sets/symfony/annotations-to-attributes.php
# using XML to load symfony config
-
path: src/ValueObjectFactory/ServiceMapFactory.php
identifier: rector.noInstanceOfStaticReflection
-
path: src/ValueObjectFactory/ServiceMapFactory.php
message: '#"@simplexml_load_string\(\$fileContents\)" is forbidden to use#'