1
0
mirror of https://github.com/danog/PHP-Parser.git synced 2025-01-22 05:41:23 +01:00

Make code more explicit

This commit is contained in:
Nikita Popov 2017-10-05 18:50:48 +02:00
parent 65de924493
commit 75880fbe2d

View File

@ -653,13 +653,14 @@ abstract class PrettyPrinterAbstract
for ($i = 0; $i < $len; $i++) {
$arrItem = $nodes[$i];
$origArrItem = $origNodes[$i];
if ($arrItem === $origArrItem) {
// Unchanged, can reuse old code
continue;
}
// We can only handle arrays of nodes meaningfully
if (!$arrItem instanceof Node || !$origArrItem instanceof Node) {
// We can only handle arrays of nodes meaningfully
// Destructing can also contain null elements. If they occur symmetrically, this is
// fine as well
if ($arrItem === null && $origArrItem === null) {
continue;
}
return null;
}