Commit f818176
committed
Remove implicit nullability deprecated in PHP 8.4
PHP 8.4 deprecates implicitly nullable parameters, i.e. typed parameter with a `null` default value, which are not explicitly declared as nullable.
See <https://wiki.php.net/rfc/deprecate-implicitly-nullable-types>
Ideally, we would just change the type hint `?DOMElement` but <https://wiki.php.net/rfc/nullable_types> was only introduced in PHP 7.1, while we still support PHP 5.6.
This patch is a somewhat hacky alternative to <#264> that fixes those warnings without breaking backwards compatibility or removing PHP < 7.1 support.
We remove the offending formal arguments in favour of obtaining them with `func_get_arg()` and checking their type ourselves.
The PHPDoc param annotations were updated to match the actual types of the now virtual arguments.
The downside is that it removes PHP 7.4’s parameter contravariance checks (https://wiki.php.net/rfc/covariant-returns-and-contravariant-parameters) so future re-introduction of the formal arguments would be a BC break.1 parent af7522b commit f818176
1 file changed
+26
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1380 | 1380 | | |
1381 | 1381 | | |
1382 | 1382 | | |
1383 | | - | |
| 1383 | + | |
1384 | 1384 | | |
1385 | 1385 | | |
1386 | | - | |
| 1386 | + | |
| 1387 | + | |
| 1388 | + | |
| 1389 | + | |
| 1390 | + | |
| 1391 | + | |
1387 | 1392 | | |
1388 | 1393 | | |
1389 | 1394 | | |
| |||
1407 | 1412 | | |
1408 | 1413 | | |
1409 | 1414 | | |
1410 | | - | |
| 1415 | + | |
1411 | 1416 | | |
1412 | 1417 | | |
1413 | 1418 | | |
1414 | | - | |
| 1419 | + | |
| 1420 | + | |
| 1421 | + | |
| 1422 | + | |
| 1423 | + | |
| 1424 | + | |
| 1425 | + | |
| 1426 | + | |
| 1427 | + | |
| 1428 | + | |
| 1429 | + | |
1415 | 1430 | | |
1416 | 1431 | | |
1417 | 1432 | | |
| |||
1513 | 1528 | | |
1514 | 1529 | | |
1515 | 1530 | | |
1516 | | - | |
| 1531 | + | |
1517 | 1532 | | |
1518 | 1533 | | |
1519 | | - | |
| 1534 | + | |
| 1535 | + | |
| 1536 | + | |
| 1537 | + | |
| 1538 | + | |
| 1539 | + | |
1520 | 1540 | | |
1521 | 1541 | | |
1522 | 1542 | | |
| |||
0 commit comments