From b11fc12ccee7e794b5b17d952b1cb0b606cf379b Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Sun, 28 Jul 2024 18:11:46 +0200 Subject: [PATCH] Use ParserFactory in integration test So we actually use the PHP 8 parser on new versions. --- test_old/run.php | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/test_old/run.php b/test_old/run.php index 2386e615..c875c87e 100644 --- a/test_old/run.php +++ b/test_old/run.php @@ -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;