Commit a359936
Fix "Using null as the key parameter for array_key_exists" PHP 8.5 warning
Our implementation diverged from upstream Less.js 3.13.1 by using an
associative array instead of a list array. Change this so that null
values naturally work, without creating an amguity between null and
the empty string (since only strings can be valid array keys).
This change triggered a Phan warning, because Phan creates a simplified
analysis of the parseMixinArgs()['args'] array that mixes up the types
of the 'name' and 'value' fields, because it ignored the keys.
```
lib/Less/Tree/Mixin/Definition.php:45 PhanTypeMismatchProperty
Assigning ($p['name'] as a field) of type non-empty-array<int,?\Less_Tree|?string>
to property but \Less_Tree_Mixin_Definition->optionalParameters is string[]
```
Fix this by declaring the array shape.
Bug: T410596
Change-Id: Ic0b5274febea3d2318282619b5f762d11d2530f91 parent 3a8e5ed commit a359936
2 files changed
Lines changed: 8 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1853 | 1853 | | |
1854 | 1854 | | |
1855 | 1855 | | |
| 1856 | + | |
1856 | 1857 | | |
1857 | 1858 | | |
1858 | 1859 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
| 26 | + | |
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
| 41 | + | |
| 42 | + | |
42 | 43 | | |
43 | 44 | | |
44 | | - | |
| 45 | + | |
45 | 46 | | |
46 | 47 | | |
47 | 48 | | |
| |||
239 | 240 | | |
240 | 241 | | |
241 | 242 | | |
242 | | - | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
243 | 246 | | |
244 | 247 | | |
245 | 248 | | |
| |||
0 commit comments