forked from tigitz/php-spellchecker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathphpstan.neon
80 lines (70 loc) · 4.46 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
includes:
- vendor/phpstan/phpstan-webmozart-assert/extension.neon
- vendor/phpstan/phpstan-strict-rules/rules.neon
- vendor/thecodingmachine/phpstan-safe-rule/phpstan-safe-rule.neon
- vendor/phpstan/phpstan-phpunit/extension.neon
parameters:
level: max
reportUnmatchedIgnoredErrors: true
ignoreErrors:
# symfony/process version testing
-
message: "#^Call to function method_exists\\(\\) with Symfony\\\\Component\\\\Process\\\\Process and 'inheritEnvironmentV…' will always evaluate to true#"
path: %currentWorkingDirectory%/src/Utils/ProcessRunner.php
# webmozart/assert missanalysis
-
message: "#^Call to static method Webmozart\\\\Assert\\\\Assert\\:\\:stringNotEmpty\\(\\) with string will always evaluate to true\\.$#"
path: %currentWorkingDirectory%/src/Misspelling.php
-
message: "#^Instanceof between PhpSpellcheck\\\\Source\\\\SourceInterface and PhpSpellcheck\\\\Source\\\\SourceInterface will always evaluate to true\\.$#"
path: %currentWorkingDirectory%/src/MisspellingFinder.php
-
message: "#^Call to static method Webmozart\\\\Assert\\\\Assert\\:\\:allIsInstanceOf\\(\\) with iterable\\<PhpSpellcheck\\\\Spellchecker\\\\SpellcheckerInterface\\> and 'PhpSpellcheck…' will always evaluate to true\\.$#"
path: %currentWorkingDirectory%/src/Spellchecker/MultiSpellchecker.php
-
message: "#^Call to static method Webmozart\\\\Assert\\\\Assert\\:\\:allIsInstanceOf\\(\\) with iterable\\<PhpSpellcheck\\\\Source\\\\SourceInterface\\> and 'PhpSpellcheck…' will always evaluate to true\\.$#"
path: %currentWorkingDirectory%/src/Source/MultiSource.php
# return type missanalysis
-
message: "#^Method PhpSpellcheck\\\\Spellchecker\\\\MultiSpellchecker\\:\\:check\\(\\) should return iterable\\<PhpSpellcheck\\\\Misspelling\\> but returns iterable\\.$#"
path: %currentWorkingDirectory%/src/Spellchecker/MultiSpellchecker.php
-
message: "#^Method PhpSpellcheck\\\\Spellchecker\\\\MultiSpellchecker\\:\\:check\\(\\) should return iterable\\<PhpSpellcheck\\\\Misspelling\\> but returns array\\<int, PhpSpellcheck\\\\MisspellingInterface\\>\\.$#"
path: %currentWorkingDirectory%/src/Spellchecker/MultiSpellchecker.php
# mixed variable is typed as intersect
-
message: "#^Call to function is_object\\(\\) with \\*NEVER\\* will always evaluate to true\\.$#"
path: %currentWorkingDirectory%/src/MisspellingFinder.php
-
message: "#^Else branch is unreachable because ternary operator condition is always true\\.$#"
path: %currentWorkingDirectory%/src/MisspellingFinder.php
-
message: "#^Call to function (is_object|is_string)\\(\\) with (\\*NEVER\\*|string) will always evaluate to true\\.$#"
path: %currentWorkingDirectory%/src/Utils/CommandLine.php
-
message: "#^Else branch is unreachable because ternary operator condition is always true\\.$#"
path: %currentWorkingDirectory%/src/Utils/CommandLine.php
# Missing strict comparison
- '#^Construct empty\(\) is not allowed. Use more strict comparison.$#'
- '#^Only booleans are allowed in#'
# $this->assert calls are OK
- '#^Dynamic call to static method PHPUnit\\Framework\\(.*)#'
# iterator_to_array in tests are safely done on \Generator class
-
message: '#^(.*)iterator_to_array expects Traversable, iterable(.*)#'
path: '%currentWorkingDirectory%/tests'
# Using Safe library in tests is too strict
-
message: '#^(.*)thecodingmachine/safe(.*)#'
path: '%currentWorkingDirectory%/tests'
# tests asserting that wrong argument types throw exception
-
message: '#^Parameter (.*) \$source of method PhpSpellcheck#'
path: '%currentWorkingDirectory%/tests/**/MisspellingFinderTest.php'
-
message: '#^Parameter (.*) \$command of class PhpSpellcheck#'
path: '%currentWorkingDirectory%/tests/**/CommandLineTest.php'
# Symfony Process class constructor doc type (array) stricter than real php type (mixed)
-
message: '#^Parameter (.*) \$command of class Symfony\\\Component\\\Process\\\Process#'
path: '%currentWorkingDirectory%/tests/**/ProcessFailedExceptionTest.php'