You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Reduce PHPStan baseline by addressing actual issues (#1083)
* Reduce PHPStan baseline by addressing actual issues
Remove 13 stale baseline entries by fixing the underlying issues:
- BakeSeedCommand: drop wrong @var annotation, cast option value;
rewrite reference foreach to track removable keys explicitly
- AbstractAdapter: tighten generateBulkInsertSql @PARAM type and
cast keys to string for array_map
- AdapterFactory: declare final constructor (allows safe new static)
- MysqlAdapter: drop redundant nested isset() checks
- Environment: useTransactions() is on the interface, drop the dead
method_exists guard; gate up()/down() dispatch with method_exists
- Manager: cast strpos result, fall back to 0 in max()
- TableFinder: drop redundant isset checks on always-set list keys
- MigrationHelper: rewrite as if/else so PHPStan can narrow the type
Two entries remain in the baseline:
- Index::setUnique dynamic dispatch (handled via continue)
- SqliteAdapter null check kept for test mock compatibility
* Apply rector fixes
Match parent visibility on inherited buildOptionParser overrides,
type the closure parameter, simplify if/else to ternary, and add
the newline rector wants.
message:'#^PHPDoc tag @var with type string is not subtype of native type non\-falsy\-string\|true\.$#'
5
-
identifier:varTag.nativeType
6
-
count:1
7
-
path:src/Command/BakeSeedCommand.php
8
-
9
-
-
10
-
message:'#^Strict comparison using \!\=\= between string and false will always evaluate to true\.$#'
11
-
identifier:notIdentical.alwaysTrue
12
-
count:1
13
-
path:src/Command/BakeSeedCommand.php
14
-
15
-
-
16
-
message:'#^Parameter \#1 \$callback of function array_map expects \(callable\(int\|string\)\: mixed\)\|null, Closure\(string\)\: string given\.$#'
17
-
identifier:argument.type
18
-
count:1
19
-
path:src/Db/Adapter/AbstractAdapter.php
20
-
21
-
-
22
-
message:'#^Unsafe usage of new static\(\)\.$#'
23
-
identifier:new.static
24
-
count:1
25
-
path:src/Db/Adapter/AdapterFactory.php
26
-
27
-
-
28
-
message:'#^Offset ''id'' on non\-empty\-array\<string, mixed\> in isset\(\) always exists and is not nullable\.$#'
29
-
identifier:isset.offset
30
-
count:2
31
-
path:src/Db/Adapter/MysqlAdapter.php
32
-
33
3
-
34
4
message:'#^Strict comparison using \!\=\= between Cake\\Database\\StatementInterface and null will always evaluate to true\.$#'
35
5
identifier:notIdentical.alwaysTrue
@@ -41,51 +11,3 @@ parameters:
41
11
identifier:method.notFound
42
12
count:1
43
13
path:src/Db/Table/Index.php
44
-
45
-
-
46
-
message:'#^Call to an undefined method Migrations\\MigrationInterface\:\:down\(\)\.$#'
47
-
identifier:method.notFound
48
-
count:1
49
-
path:src/Migration/Environment.php
50
-
51
-
-
52
-
message:'#^Call to an undefined method Migrations\\MigrationInterface\:\:up\(\)\.$#'
53
-
identifier:method.notFound
54
-
count:1
55
-
path:src/Migration/Environment.php
56
-
57
-
-
58
-
message:'#^Call to function method_exists\(\) with Migrations\\MigrationInterface and ''useTransactions'' will always evaluate to true\.$#'
59
-
identifier:function.alreadyNarrowedType
60
-
count:1
61
-
path:src/Migration/Environment.php
62
-
63
-
-
64
-
message:'#^Method Migrations\\Migration\\Manager\:\:getMigrationClassName\(\) should return class\-string\<Migrations\\MigrationInterface\> but returns string\.$#'
65
-
identifier:return.type
66
-
count:2
67
-
path:src/Migration/Manager.php
68
-
69
-
-
70
-
message:'#^Parameter \#1 \.\.\.\$arg1 of function max expects non\-empty\-array, array given\.$#'
71
-
identifier:argument.type
72
-
count:1
73
-
path:src/Migration/Manager.php
74
-
75
-
-
76
-
message:'#^Parameter \#3 \$length of function substr expects int\|null, int\<0, max\>\|false given\.$#'
77
-
identifier:argument.type
78
-
count:1
79
-
path:src/Migration/Manager.php
80
-
81
-
-
82
-
message:'#^Offset 0 on non\-empty\-list\<string\> in isset\(\) always exists and is not nullable\.$#'
83
-
identifier:isset.offset
84
-
count:2
85
-
path:src/Util/TableFinder.php
86
-
87
-
-
88
-
message:'#^Possibly invalid array key type Cake\\Database\\Schema\\TableSchemaInterface\|string\.$#'
0 commit comments