Commit acf2a54
committed
PHP 8.5 | Tokenizer/PHP: fix "Using null as an array offset" deprecation
If an attribute is unclosed (missing the closing `]` bracket), the `PHP::findCloser()` returns `null`, which will lead to the PHP 8.5 deprecation notice.
This can only occur during live coding or when a file has a parse error, but PHPCS should handle that situation gracefully.
Fixed now.
This change is already covered via the existing tests.
Ref: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_using_values_null_as_an_array_offset_and_when_calling_array_key_exists1 parent c019c75 commit acf2a54
1 file changed
+8
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1468 | 1468 | | |
1469 | 1469 | | |
1470 | 1470 | | |
| 1471 | + | |
1471 | 1472 | | |
1472 | | - | |
1473 | | - | |
1474 | | - | |
| 1473 | + | |
| 1474 | + | |
| 1475 | + | |
| 1476 | + | |
1475 | 1477 | | |
1476 | | - | |
1477 | | - | |
| 1478 | + | |
| 1479 | + | |
| 1480 | + | |
1478 | 1481 | | |
1479 | 1482 | | |
1480 | | - | |
1481 | 1483 | | |
1482 | 1484 | | |
1483 | 1485 | | |
| |||
0 commit comments