This repository has been archived by the owner on Dec 3, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 191
/
phpstan.neon
125 lines (100 loc) · 8.23 KB
/
phpstan.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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
includes:
- 'packages/phpstan-extensions/config/config.neon'
parameters:
level: max
checkGenericClassInNonGenericObjectType: false
reportUnmatchedIgnoredErrors: false
excludes_analyse:
- *packages/monorepo-builder/packages/init/templates/*
- *packages/coding-standard/tests/**/correct*
- *packages/coding-standard/tests/**/wrong*
- *packages/coding-standard/tests/**/Wrong*
- *packages/phpstan-extensions/**/Source/**
- */vendor/*
# tests
- packages/phpstan-extensions/tests/Rules/Classes/Source/ClassWithConstants.php
- packages/easy-coding-standard/packages/sniff-runner/tests/Application/FileProcessorSource/ReferenceUsedNamesOnlySniff/
# Symfony workaround
- packages/changelog-linker/src/DependencyInjection/Dummy/ResolveAutowiringExceptionHelper.php
# 3rd party
- packages/easy-coding-standard/packages/sniff-runner/src/ValueObject/File.php
# tests
- packages/phpstan-extensions/tests/Rules/ClassMethod/Source/*
- packages/easy-coding-standard/compiler/vendor/*
autoload_files:
- %currentWorkingDirectory%/tests/bootstrap.php
- packages/easy-coding-standard/packages/changed-files-detector/tests/ChangedFilesDetectorSource/OneClass.php
- packages/easy-coding-standard/tests/Finder/SourceFinderSource/Source/SomeClass.php
ignoreErrors:
# command argument value type conversion - known string
-
message: '#Cannot cast array<string>\|string\|null to string#'
path: '*packages/*Command.php'
# lvl 7
- '#Parameter \#2 \$config of class PHP_CodeSniffer\\Tokenizers\\PHP constructor expects PHP_CodeSniffer\\Config\|null, PHP_CodeSniffer\\Config\|stdClass given#'
# invalid 3rd party-code
- '#Parameter \#1 \$index of method PhpCsFixer\\Tokenizer\\Tokens::getNextTokenOfKind\(\) expects int, int\\|null given#'
- '#Variable \$processedFileContent might not be defined#'
# known values
- '#Parameter \#2 \$start of method PHP_CodeSniffer\\Files\\File::findNext\(\) expects int, (.*?) given#'
# required for autowiring, since only interface is autowired
- '#Call to an undefined method Symfony\\Component\\DependencyInjection\\ContainerInterface::getParameterBag()#'
# buggy
- '#Symplify\\EasyCodingStandard\\Contract\\Application\\DualRunInterface#'
# intersect/union buggy
- '#Parameter \#(2|3) \$items of method PhpCsFixer\\Tokenizer\\Tokens::(insertAt|overrideRange)\(\) expects (\()?iterable<PhpCsFixer\\Tokenizer\\Token>&PhpCsFixer\\Tokenizer\\Tokens(\))?(\|PhpCsFixer\\Tokenizer\\Token)?, array<(int, )?PhpCsFixer\\Tokenizer\\Token> given#'
- '#expects Symfony\\Component\\DependencyInjection\\ContainerBuilder, Symfony\\Component\\DependencyInjection\\ContainerInterface given#'
# phpstan 0.10 news
- '#Cannot call method contains\(\) on array<array<string>>\|SplObjectStorage#'
- '#Cannot call method attach\(\) on array<array<string>>\|SplObjectStorage#'
- '#Parameter \#1 \$path of function dirname expects string, string\|false given#'
- '#Method Symplify\\PackageBuilder\\Console\\Command\\CommandNaming::getShortClassName\(\) should return string but returns string\|null#'
- '#Cannot call method getStart\(\) on Symplify\\CodingStandard\\TokenRunner\\ValueObject\\BlockInfo\|null#'
- '#Method Symplify\\CodingStandard\\TokenRunner\\Analyzer\\SnifferAnalyzer\\CognitiveComplexityAnalyzer::getMeasuredNestingLevel\(\) should return int but returns float\|int#'
# variadic
- '#PHPDoc tag \@param for parameter (.*?) with type array is not subtype of native type array<int, mixed>#'
# mixed up iterables
- '#PHPDoc tag @return with type array<string\> is incompatible with native type Iterator#'
# Symfony 4.2 typehint BC-break
- '#Parameter \#1 \$command of class Symfony\\Component\\Process\\Process constructor expects array, array<string>\|string given#'
# false positive, known
- '#Cannot cast array<string>\|bool\|string\|null to string#'
- '#Cannot cast array<string>\|bool\|string\|null to int#'
# console argument/option
- '#Cannot cast array<string\>\|bool\|string to string#'
# known values
- '#Parameter \#1 \$code of static method PhpCsFixer\\Tokenizer\\Tokens\:\:fromCode\(\) expects string, string\|false given#'
- '#Cannot call method (get|has)\(\) on (.*?)\|null#'
- '#Static property Symplify\\PackageBuilder\\Tests\\AbstractKernelTestCase\:\:\$container \(Psr\\Container\\ContainerInterface\) does not accept object\|null#'
- '#Call to an undefined method Psr\\Container\\ContainerInterface\:\:set\(\)#'
- '#Static property Symplify\\PackageBuilder\\Tests\\AbstractKernelTestCase\:\:\$container \(Psr\\Container\\ContainerInterface\) does not accept null#'
# false positive
- '#Unreachable statement \- code above always terminates#'
- '#Property Symplify\\Autodiscovery\\Tests\\Twig\\TwigPathAutodiscoveryTest\:\:\$twigFilesystemLoader \(Twig\\Loader\\FilesystemLoader\) does not accept Twig\\Loader\\LoaderInterface#'
# false positive
- '#Cannot assign offset \(int\|string\) to PhpCsFixer\\Tokenizer\\Tokens#'
- '#Parameter \#1 \$subject of static method Nette\\Utils\\Strings\:\:match\(\) expects string, string\|false given#'
# yield iterator
- '#Parameter \#1 \$filename of function filesize expects string, string\|false given#'
- '#Method Symplify\\SetConfigResolver\\Finder\\SetFileFinder\:\:detectFromInputAndDirectory\(\) should return string\|null but return statement is missing#'
- '#Parameter \#1 \$unversionedSets of method Symplify\\SetConfigResolver\\SetResolver\:\:createSetListInString\(\) expects array<string\>, array<array<string\>\|string\> given#'
- '#Parameter \#2 \$versionedSets of method Symplify\\SetConfigResolver\\SetResolver\:\:createSetListInString\(\) expects array<array<string\>\>, array<array<string\>\|string\> given#'
- '#Parameter \#1 \$files of method Symplify\\SmartFileSystem\\Finder\\FinderSanitizer\:\:sanitize\(\) expects \(iterable<SplFileInfo\|string\>&Nette\\Utils\\Finder\)\|Symfony\\Component\\Finder\\Finder, array<int, SplFileInfo\> given#'
- '#Cannot access offset int on int#'
- '#Call to an undefined method ReflectionType\:\:getName\(\)#'
- '#Parameter \#1 \$argument of class ReflectionClass constructor expects class\-string<T of object\>\|T of object, string given#'
# helps ide
- '#Method Symplify\\CodingStandard\\TokenRunner\\Tests\\Analyzer\\SniffAnalyzer\\CognitiveComplexityAnalyzer\\CognitiveComplexityAnalyzerTest\:\:getLegacyConfig\(\) never returns PHP_CodeSniffer\\Config so it can be removed from the return typehint#'
# mixed by default, handled by coding standards
- '#(has|with) no (return )?typehint specified#'
- '#Offset (.*?) does not exist on array\|null#'
- '#in iterable type#'
- '#Strict comparison using \=\=\= between string\|false and null will always evaluate to false#'
- '#Parameter \#1 \$jsonContent of method Symplify\\EasyCodingStandard\\Compiler\\Packagist\\SymplifyStableVersionProvider\:\:loadContentJsonStringToArray\(\) expects string, string\|false given#'
- '#Method Symplify\\EasyCodingStandard\\Compiler\\Packagist\\SymplifyStableVersionProvider\:\:getLastKey\(\) should return string but returns int\|string\|null#'
- '#Parameter \#3 \$end of method PHP_CodeSniffer\\Files\\File\:\:findNext\(\) expects int\|null, (.*?)#'
- '#Property Symplify\\CodingStandard\\TokenRunner\\ValueObject\\Wrapper\\FixerWrapper\\FixerClassWrapper\:\:\$startBracketIndex \(int\) does not accept int\|null#'
- '#Parameter \#1 \$array of method (.*?)\\ArraySorter\:\:recursiveSort\(\) expects array, array\|string given#'
- '#Cannot assign offset (.*?) to array\|string#'
- '#Cannot assign offset int\|null to PhpCsFixer\\Tokenizer\\Tokens#'
- '#Parameter \#3 \$position of method Symplify\\CodingStandard\\TokenRunner\\Analyzer\\SnifferAnalyzer\\CognitiveComplexityAnalyzer\:\:isIncrementingToken\(\) expects int, float\|int given#'