Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nikic/php-parser v4 BC layer for renamed classes #3529

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions compiler/src/Console/PrepareCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,8 @@ private function buildPreloadScript(): void
$template = <<<'php'
<?php declare(strict_types = 1);

use PhpParser\Node;

%s
php;
$finder = Finder::create();
Expand Down Expand Up @@ -203,6 +205,8 @@ private function buildPreloadScript(): void
$output .= 'require_once __DIR__ . ' . var_export($path, true) . ';' . "\n";
}

$output .= 'class_alias(Node\\ArrayItem::class, Node\\Expr\\ArrayItem::class);' . "\n";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we somehow make uses of the old class be reported as deprecation errors?


file_put_contents($preloadScript, sprintf($template, $output));
}

Expand Down
Loading