mirror of
https://github.com/nikic/PHP-Parser.git
synced 2025-06-20 06:47:56 +02:00
Use ParserFactory in integration test
So we actually use the PHP 8 parser on new versions.
This commit is contained in:
@ -127,12 +127,7 @@ switch ($testType) {
|
||||
showHelp('Test type must be one of: PHP or Symfony');
|
||||
}
|
||||
|
||||
$lexer = new PhpParser\Lexer\Emulative(\PhpParser\PhpVersion::fromString($phpVersion));
|
||||
if (version_compare($phpVersion, '7.0', '>=')) {
|
||||
$parser = new PhpParser\Parser\Php7($lexer);
|
||||
} else {
|
||||
$parser = new PhpParser\Parser\Php5($lexer);
|
||||
}
|
||||
$parser = (new PhpParser\ParserFactory())->createForVersion(PhpParser\PhpVersion::fromString($phpVersion));
|
||||
$prettyPrinter = new PhpParser\PrettyPrinter\Standard;
|
||||
$nodeDumper = new PhpParser\NodeDumper;
|
||||
|
||||
|
Reference in New Issue
Block a user