Repository navigation
Expand file tree
/
Copy pathphpstan.neon.dist
More file actions
48 lines (48 loc) · 2.46 KB
/
Copy pathphpstan.neon.dist
File metadata and controls
48 lines (48 loc) · 2.46 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
parameters:
level: 8
paths:
- src
# We use assert() calls to help Psalm narrow types which PHPStan already knows about from our PHPDocs
treatPhpDocTypesAsCertain: false
ignoreErrors:
- path: src/Reference/ReferenceParser.php
message: '#Parameter .+ of class .+Reference constructor expects string, string\|null given#'
- path: src/Util/RegexHelper.php
message: '#Method .+RegexHelper::unescape\(\) should return string but returns string\|null#'
- path: src/Delimiter/DelimiterStack.php
message: '#unknown class WeakMap#'
# PHPStan treats our `@psalm-readonly` and `@psalm-readonly-allow-private-mutation` annotations as its own,
# stricter `@readonly`. All of these properties are only ever mutated by their declaring class, which is
# exactly what those Psalm annotations permit.
- identifier: property.uninitializedReadonlyByPhpDoc
- identifier: property.readOnlyByPhpDocDefaultValue
- identifier: argument.byRef
# Similarly, our `@psalm-pure` methods call functions like preg_match() which PHPStan cannot prove are pure
# because of their by-reference parameters.
- identifier: possiblyImpure.functionCall
# Nullable return types are part of our public API, so implementations must keep them even if they never
# actually return null themselves.
- identifier: return.unusedType
# PHPStan knows that variadic parameters are already lists, but Psalm doesn't, so we can't drop array_values()
- identifier: arrayValues.list
reportUnmatched: false
exceptions:
uncheckedExceptionClasses:
# Exceptions caused by bad developer logic that should always bubble up:
- 'League\CommonMark\Exception\AlreadyInitializedException'
- 'League\CommonMark\Exception\InvalidArgumentException'
- 'League\CommonMark\Exception\MissingDependencyException'
- 'League\CommonMark\Exception\UnexpectedEncodingException'
- 'League\CommonMark\Parser\ParserLogicException'
- 'League\CommonMark\Renderer\NoMatchingRendererException'
- 'League\Config\Exception\InvalidConfigurationException'
- 'League\Config\Exception\UnknownOptionException'
- 'League\Config\Exception\ValidationException'
- 'TypeError'
# Should never be thrown by our code:
- 'Dflydev\DotAccessData\Exception\DataException'
- 'Dflydev\DotAccessData\Exception\InvalidPathException'
check:
missingCheckedExceptionInThrows: true
rules:
- 'League\CommonMark\Tests\PHPStan\MbstringFunctionCallRule'