-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Expand file tree
/
Copy pathphpstan.dist.neon
More file actions
94 lines (82 loc) · 4.62 KB
/
phpstan.dist.neon
File metadata and controls
94 lines (82 loc) · 4.62 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
85
86
87
88
89
90
91
92
93
94
includes:
- dev-tools/vendor/phpstan/phpstan/conf/bleedingEdge.neon
# Baseline, should only shrink! To regenerate it, just execute `composer phpstan:baseline`.
- dev-tools/phpstan/baseline/_loader.php
parameters:
level: 7
paths:
- src
- tests
- php-cs-fixer
- .php-cs-fixer.dist.php
- dev-tools/phpstan/src
excludePaths:
- tests/Fixtures
polluteScopeWithLoopInitialAssignments: true # Do not enforce assignments outside of the loops
reportUnmatchedIgnoredErrors: true # Do not allow outdated errors in the baseline
reportPossiblyNonexistentGeneralArrayOffset: true # enabled, but huge exceptions count; example fix: https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/pull/8089
reportPossiblyNonexistentConstantArrayOffset: true
treatPhpDocTypesAsCertain: false
ignoreErrors:
- '/^Class [a-zA-Z\\]+ extends @final class PhpCsFixer\\(ConfigurationException\\InvalidConfigurationException|ConfigurationException\\InvalidFixerConfigurationException|Tokenizer\\Tokens|Console\\Command\\FixCommand)\.$/'
-
rawMessage: 'Call to internal method PHPUnit\Framework\TestCase::addToAssertionCount() from outside its root namespace PHPUnit.'
identifier: method.internal
# We often need to iterate multiple times within single method and we re-use variable name
-
message: '/^For loop initial assignment overwrites variable \$(i|index|endIndex)+\.$/'
paths:
- src/Fixer/Comment/CommentToPhpdocFixer.php
- src/Fixer/ControlStructure/YodaStyleFixer.php
- src/Fixer/Import/GlobalNamespaceImportFixer.php
- src/Fixer/Import/OrderedImportsFixer.php
- src/Fixer/LanguageConstruct/SingleSpaceAroundConstructFixer.php
- src/Fixer/Operator/NoUselessConcatOperatorFixer.php
- src/Fixer/PhpUnit/PhpUnitDedicateAssertInternalTypeFixer.php
- src/Fixer/ReturnNotation/ReturnAssignmentFixer.php
- src/Fixer/Whitespace/StatementIndentationFixer.php
- tests/DocBlock/TypeExpressionTest.php
-
message: '/^Foreach overwrites \$index with its key variable.$/'
paths:
- src/Fixer/DoctrineAnnotation/DoctrineAnnotationIndentationFixer.php
- src/Fixer/Import/GlobalNamespaceImportFixer.php
- src/Fixer/LanguageConstruct/GetClassToClassKeywordFixer.php
# We allow own config to eat internal rules/sets
-
message: '/(on|of) internal class.*(Set|Fixer)/'
paths:
- .php-cs-fixer.dist.php
# Types related to tokens collections are purposefully narrowed, because we expect only tokens there
- '/^Parameter #1 \$array \(array<int, PhpCsFixer\\(Tokenizer|Doctrine\\Annotation)+\\Token>\) of method PhpCsFixer\\(Tokenizer|Doctrine\\Annotation)+\\Tokens::fromArray\(\) should be contravariant with parameter \$array \(array<int, mixed>\) of method SplFixedArray<PhpCsFixer\\(Tokenizer|Doctrine\\Annotation)+\\Token>::fromArray\(\)$/'
- '/^Parameter .* of method PhpCsFixer\\Tokenizer\\Tokens::offsetSet\(\) should be contravariant with parameter .* of method .*::offsetSet\(\)$/'
- '/^Parameter .* of method PhpCsFixer\\Tests\\Test\\TokensWithObservedTransformers::offsetSet\(\) should be contravariant with parameter .* of method .*::offsetSet\(\)$/'
# We often access tokens collection with `int|null` because our token traversing methods (`getNextMeaningfulToken` etc.) have nullable return type at the moment
-
message: '/^Offset int(<0, max>)?\|null might not exist on (\$this\()?PhpCsFixer\\Tokenizer\\Tokens\)?\.$/'
identifier: offsetAccess.notFound
-
message: '/^Unused PhpCsFixer\\[a-zA-Z\\]+Interface::[a-zA-Z]+$/'
path: src
count: 19
-
message: '/^AnonymousClass/'
path: tests/
identifier: phpCsFixer.internalTypeInPublicApi
tipsOfTheDay: false
symfony:
consoleApplicationLoader: dev-tools/phpstan/console-application.php
tmpDir: dev-tools/phpstan/cache
services:
-
class: PhpCsFixer\PHPStan\Rules\NoInternalTypesInPublicApiRule
tags:
- phpstan.rules.rule
-
class: PhpCsFixer\PHPStan\Extension\PregMatchParameterOutExtension
tags:
- phpstan.staticMethodParameterOutTypeExtension
-
class: PhpCsFixer\PHPStan\Extension\PregMatchTypeSpecifyingExtension
tags:
- phpstan.typeSpecifier.staticMethodTypeSpecifyingExtension