Skip to content

Commit c39e2b9

Browse files
committed
nikic/php-parser v4 BC layer for renamed classes
1 parent b009a44 commit c39e2b9

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

compiler/src/Console/PrepareCommand.php

+4
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,8 @@ private function buildPreloadScript(): void
166166
$template = <<<'php'
167167
<?php declare(strict_types = 1);
168168
169+
use PhpParser\Node;
170+
169171
%s
170172
php;
171173
$finder = Finder::create();
@@ -203,6 +205,8 @@ private function buildPreloadScript(): void
203205
$output .= 'require_once __DIR__ . ' . var_export($path, true) . ';' . "\n";
204206
}
205207

208+
$output .= 'class_alias(Node\\ArrayItem::class, Node\\Expr\\ArrayItem::class);' . "\n";
209+
206210
file_put_contents($preloadScript, sprintf($template, $output));
207211
}
208212

0 commit comments

Comments
 (0)