From 882eebe3315392654646c322ac6eb7c8516e4f91 Mon Sep 17 00:00:00 2001 From: vol4onok Date: Tue, 12 Mar 2024 19:05:48 +0200 Subject: [PATCH] BC fix --- src/Parser/PhpParser.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Parser/PhpParser.php b/src/Parser/PhpParser.php index 2575d1d..3bd1cb1 100644 --- a/src/Parser/PhpParser.php +++ b/src/Parser/PhpParser.php @@ -26,7 +26,7 @@ class PhpParser implements PhpParserInterface */ public function __construct(ParserFactory $parserFactory) { - $this->parser = $parserFactory->createForNewestSupportedVersion(); + $this->parser = method_exists($parserFactory, 'createForNewestSupportedVersion') ? $parserFactory->createForNewestSupportedVersion() : $parserFactory->create(ParserFactory::PREFER_PHP7); } /**