-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathphpstan.neon
More file actions
44 lines (41 loc) · 3.19 KB
/
phpstan.neon
File metadata and controls
44 lines (41 loc) · 3.19 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
includes:
- vendor/phpstan/phpstan/conf/bleedingEdge.neon
- vendor/phpstan/phpstan-webmozart-assert/extension.neon
- vendor/jiripudil/phpstan-sealed-classes/extension.neon
parameters:
level: max
tmpDir: ./tmp/phpstan
paths:
- src
reportUnmatchedIgnoredErrors: false
ignoreErrors:
# They do have the type specified. I don't know what PHPStan is on about here.
- '#Method GoodPhp\\Reflection\\Reflection\\Methods\\MergedInheritanceMethodReflection::invoke\(\) has parameter \$args with no type specified.#'
- '#Method GoodPhp\\Reflection\\Reflection\\Methods\\MergedInheritanceMethodReflection::invokeLax\(\) has parameter \$args with no type specified.#'
# PHPStan doesn't understand that Collection::values() produces a list
- '#Method .*::.* should return list<(.*)> but returns array<(int, )?\1>.#i'
- '#Parameter [\$|\#].* of .* expects list<(.*)>(|.*)?, (array|non-empty-array)<(int, )?\1> given.#i'
- '#Property .*::\$.* \(list<(.*)>\) does not accept (array|non-empty-array)<(int, )?\1>.#i'
- '#Parameter \#1 \$type of method GoodPhp\\Reflection\\NativePHPDoc\\Definition\\NativePHPDoc\\Native\\NativeTypeMapper::map\(\) expects list<ReflectionType\|string>\|ReflectionType\|string, array<ReflectionType> given.#i'
- '#Method GoodPhp\\Reflection\\NativePHPDoc\\Definition\\NativePHPDoc\\File\\ClassLikeContextParsingVisitor::methods\(\) should return list<string> but returns array<non-empty-string>.#i'
# Missing template types
- '#Method GoodPhp\\Reflection\\Type\\Template\\TypeParameterMap::toArguments\(\) should return list<GoodPhp\\Reflection\\Type\\Type> but returns array.#i'
# Intentionally left as nullable. If there was a solid way of checking if a property is initialized
# in PHP, then these would in fact be assigned nulls if definitions contain null types.
- '#Property GoodPhp\\Reflection\\NativePHPDoc\\Reflection\\Npd.*::.* \(GoodPhp\\Reflection\\Type\\(NamedType|Type)\|null\) is never assigned null so it can be removed from the property type.#i'
# It is in fact nullable. Probably a bug in PHPStan.
- '#Using nullsafe property access \"\?->excludedTraitMethods\" on left side of \?\? is unnecessary. Use -> instead.#i'
# Bug with inherited readonly properties
- '#Readonly property [a-z\\]+::\$[a-z0-9]+ is assigned outside of the constructor.#i'
- '#Class [a-z\\]+ has an uninitialized readonly property \$[a-z0-9]+\. Assign it in the constructor.#i'
# We expect proper error handling, in which case file_get_contents() will never return `false`
-
message: '#Parameter \#1 \$code of method PhpParser\\Parser::parse\(\) expects string, string\|false given\.#i'
path: 'src/NativePHPDoc/Definition/NativePHPDoc/File/FileContextParser.php'
-
message: '#Parameter \#2 \$aliases of class GoodPhp\\Reflection\\NativePHPDoc\\Definition\\NativePHPDoc\\File\\FileClassLikeContext\\TraitUse constructor expects list<array{string, string\|null, [\d\|]+null}>, list<array{non-empty-string, non-falsy-string\|null, int<min, -1>\|int<1, max>\|null}> given\.#i'
path: 'src/NativePHPDoc/Definition/NativePHPDoc/File/ClassLikeContextParsingVisitor.php'
# This, again, I'm not sure how to approach
-
message: '#Unsafe usage of new static\(\)#i'
path: 'src/Util/IsSingleton.php'