forked from PHP-CS-Fixer/PHP-CS-Fixer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
phpstan.dist.neon
71 lines (63 loc) · 4.13 KB
/
phpstan.dist.neon
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
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.php
parameters:
level: 7
paths:
- src
- tests
- php-cs-fixer
- 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)\.$/'
- '/^\$this\(PhpCsFixer\\Tokenizer\\Tokens\) does not accept PhpCsFixer\\Tokenizer\\Token\|null\.$/'
# 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
# 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 retrieve these FQNs in various ways, we process them along the way, let's assume it's always class-string
- '/^Parameter #2 \$fullName of class PhpCsFixer\\Tokenizer\\Analyzer\\Analysis\\NamespaceUseAnalysis constructor expects class-string, string given\.$/'
# PHPUnit data providers return type were not maintained originally, this exception should shrink over time (eg with help of custom, re-usable type)
-
message: '#^Method PhpCsFixer\\Tests\\.+::provide.+Cases\(\) return type has no value type specified in iterable type iterable\.$#'
path: tests
count: 265
tipsOfTheDay: false
tmpDir: dev-tools/phpstan/cache
services:
-
class: PhpCsFixer\PHPStan\Extension\PregMatchParameterOutExtension
tags:
- phpstan.staticMethodParameterOutTypeExtension
-
class: PhpCsFixer\PHPStan\Extension\PregMatchTypeSpecifyingExtension
tags:
- phpstan.typeSpecifier.staticMethodTypeSpecifyingExtension