-
-
Notifications
You must be signed in to change notification settings - Fork 164
Expand file tree
/
Copy pathphpstan-baseline.php
More file actions
44 lines (40 loc) · 2.3 KB
/
phpstan-baseline.php
File metadata and controls
44 lines (40 loc) · 2.3 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
<?php declare(strict_types = 1);
$ignoreErrors = [];
$ignoreErrors[] = [
'message' => '#^Property Doctrine\\\\ORM\\\\Mapping\\\\ClassMetadata\\<object\\>\\:\\:\\$table \\(array\\{name\\: string, schema\\?\\: string, indexes\\?\\: array, uniqueConstraints\\?\\: array, options\\?\\: array\\<string, mixed\\>, quoted\\?\\: bool\\}\\) does not accept array\\{\\}\\.$#',
'identifier' => 'assign.propertyType',
'count' => 1,
'path' => __DIR__ . '/src/Bridge/Doctrine/MetadataLoadInterceptor.php',
];
$ignoreErrors[] = [
'message' => '#^Trait Go\\\\Proxy\\\\Part\\\\PropertyInterceptionTrait is used zero times and is not analysed\\.$#',
'identifier' => 'trait.unused',
'count' => 1,
'path' => __DIR__ . '/src/Proxy/Part/PropertyInterceptionTrait.php',
];
// CachePathManager: the cache file loaded via `include` returns `mixed` at compile time.
// After is_array() narrowing, PHPStan gives array<mixed, mixed> (losing the string key type).
// The cache files are written by the framework itself (via var_export), so the shape is trusted.
$ignoreErrors[] = [
'message' => '#^Property Go\\\\Instrument\\\\ClassLoading\\\\CachePathManager\\:\\:\\$cacheState \\(array\\<string, mixed\\>\\) does not accept array\\<mixed, mixed\\>\\.$#',
'identifier' => 'assign.propertyType',
'count' => 1,
'path' => __DIR__ . '/src/Instrument/ClassLoading/CachePathManager.php',
];
$ignoreErrors[] = [
'message' => '#^Method Go\\\\Instrument\\\\ClassLoading\\\\CachePathManager\\:\\:queryCacheState\\(\\) should return array\\<string, mixed\\>\\|null but returns array\\<mixed, mixed\\>\\|null\\.$#',
'identifier' => 'return.type',
'count' => 2,
'path' => __DIR__ . '/src/Instrument/ClassLoading/CachePathManager.php',
];
// WeavingTransformer: ReflectionFileNamespace::getNamespaceAliases() in the vendor library
// (goaop/parser-reflection) has no return type annotation — it returns array<string, string|null>
// in practice (alias name or null for unaliased imports), but PHPStan infers array<mixed>.
// The cast (string) $alias is safe since values are always string|null from the implementation.
$ignoreErrors[] = [
'message' => '#^Cannot cast mixed to string\\.$#',
'identifier' => 'cast.string',
'count' => 1,
'path' => __DIR__ . '/src/Instrument/Transformer/WeavingTransformer.php',
];
return ['parameters' => ['ignoreErrors' => $ignoreErrors]];