-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathphpstan.php
More file actions
62 lines (60 loc) · 3.09 KB
/
Copy pathphpstan.php
File metadata and controls
62 lines (60 loc) · 3.09 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
<?php
use Modufolio\Appkit\PHPStan\Doctrine\ObjectMetadataResolver;
return [
'includes' => [
__DIR__.'/extension.php',
],
'services' => [
'appkitDoctrine.objectMetadataResolver' => [
'class' => ObjectMetadataResolver::class,
'arguments' => [
'objectManagerLoader' => __DIR__.'/tests/phpstan-object-manager.php',
],
],
],
'parameters' => [
'level' => 5,
'paths' => ['src', 'tests'],
'excludePaths' => [
'analyseAndScan' => [
'vendor/*',
// Toolkit: utility classes ported from Kirby CMS; excluded from
// static analysis.
'src/Toolkit/*',
// Code-generation templates: variables are populated via extract()
// at render time, so they're intentionally undefined here.
'src/Console/Resources/skeleton/*',
// Fixture files: sample "app" source code used as generator
// input/output in tests, referencing intentionally fake classes.
'tests/*/fixtures/*',
'tests/*/*/fixtures/*',
// These tests generate `use` statements / attribute nodes from arbitrary
// FQCN strings purely to exercise string-formatting logic; the FQCNs are
// deliberately fictitious and never actually loaded or instantiated.
'tests/Unit/Util/ClassSourceManipulatorTest.php*',
'tests/Unit/Util/UseStatementGeneratorTest.php*',
// Collection/Html use PHP magic methods (__get/__set/__call/__callStatic)
// over genuinely arbitrary, unenumerable keys/tags — not visible to static
// analysis without a dedicated PHPStan reflection extension.
'tests/Unit/Toolkit/CollectionGetterTest.php*',
'tests/Unit/Toolkit/CollectionMutatorTest.php*',
'tests/Unit/Toolkit/HtmlTest.php*',
// Fixture controller classes whose constructors are never invoked —
// only inspected via Reflection to test argument-resolution metadata.
'tests/Unit/DependencyInjection/ReflectionControllerArgumentResolverTest.php*',
],
],
'bootstrapFiles' => [
'phpstan-bootstrap.php',
],
'ignoreErrors' => [
// Doctrine ORM writes $id via reflection — not visible to static analysis
['message' => '#Property .+::\$id is never written, only read\.#', 'reportUnmatched' => false],
['message' => '#Property .+::\$id \(int\|null\) is never assigned int so it can be removed from the property type\.#', 'reportUnmatched' => false],
// PHPStan extension code necessarily depends on non-BC-covered
// reflection internals (DummyParameter) — same trade-off phpstan-doctrine
// itself makes for the equivalent magic-method reflection extension.
['identifier' => 'phpstanApi.constructor', 'path' => 'src/PHPStan/*', 'reportUnmatched' => false],
],
],
];