Repository navigation
Expand file tree
/
Copy pathphpstan.neon
More file actions
67 lines (51 loc) · 2.83 KB
/
Copy pathphpstan.neon
File metadata and controls
67 lines (51 loc) · 2.83 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
includes:
- config/services/services.neon
- config/naming-rules.neon
- config/phpstan-extensions.neon
parameters:
treatPhpDocTypesAsCertain: false
errorFormat: symplify
level: 8
# typed constants (8.3) are not available on PHP 7.4
type_coverage:
constant_type: 0
param_type: 99
paths:
- src
- config
- tests
excludePaths:
# parallel
- packages/*-phpstan-printer/tests/*ToPhpCompiler/Fixture*
# tests
- '*/tests/**/Source/*'
- */stubs/*
- */Fixture/*
ignoreErrors:
# rule/collector constructors are instantiated by the PHPStan DI container, not visible to dead-code-detector during self-analysis
- '#^Unused .*?::__construct$#'
- '#Method Symplify\\PHPStanRules\\Reflection\\ReflectionParser\:\:parseNativeClassReflection\(\) has parameter \$reflectionClass with generic class ReflectionClass but does not specify its types\: T#'
# overly detailed
- '#Class Symplify\\PHPStanRules\\(.*?) extends generic class PHPStan\\Testing\\RuleTestCase but does not specify its types\: TRule#'
- '#Method Symplify\\PHPStanRules\\(.*?)\:\:getRule\(\) return type with generic interface PHPStan\\Rules\\Rule does not specify its types\: TNodeType#'
- '#Parameter \#2 \$expectedErrors of method PHPStan\\Testing\\RuleTestCase<PHPStan\\Rules\\Rule>\:\:analyse\(\) expects list<array\{0\: string, 1\: int, 2\?\: string\|null\}>, (.*?) given#'
# useful to have IDE know the types
- identifier: phpstanApi.instanceofType
# fast effective check
-
message: '#Function is_a\(\) is a runtime reflection concept that might not work in PHPStan because it uses fully static reflection engine#'
path: src/Rules/SeeAnnotationToTestRule.php
# PHP 7.4 compatibility shim - getAttributes() only exists on PHP 8.0+
-
message: '#Call to function method_exists\(\) with ReflectionMethod and .getAttributes. will always evaluate to true#'
path: src/Rules/Symfony/RequireRouteNameToGenerateControllerRouteRule.php
-
message: '#Generator expects value type array<string, mixed>, list<bool\|float\|int\|list<string>\|PHPStan\\TrinaryLogic\|string\|null> given#'
path: tests/ReturnTypeExtension/*
# PHPStan testing helper, intentionally extended
-
message: '#is not covered by backward compatibility promise#'
path: tests/ErrorFormatter/SymplifyErrorFormatterTest.php
- '#Although PHPStan\\Node\\InClassNode is covered by backward compatibility promise, this instanceof assumption might break because (.*?) not guaranteed to always stay the same#'
# not useful
- '#with generic class ReflectionAttribute (but )?does not specify its types#'