File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1515use PhpParser \NodeTraverser ;
1616use PhpParser \NodeVisitor ;
1717use PhpParser \ParserFactory ;
18- use PhpParser \PhpVersion ;
1918use Symfony \Component \Finder \SplFileInfo ;
2019use Translation \Extractor \Model \SourceCollection ;
2120use Translation \Extractor \Visitor \Visitor ;
@@ -33,8 +32,7 @@ final class PHPFileExtractor implements FileExtractor
3332 public function getSourceLocations (SplFileInfo $ file , SourceCollection $ collection ): void
3433 {
3534 $ path = $ file ->getRelativePath ();
36- /** @phpstan-ignore-next-line */
37- $ parser = (new ParserFactory ())->createForVersion (PhpVersion::fromString ('8.1 ' ));
35+ $ parser = (new ParserFactory ())->createForHostVersion ();
3836 $ traverser = new NodeTraverser ();
3937 $ traverser ->addVisitor (new NodeVisitor \NameResolver ());
4038 foreach ($ this ->visitors as $ v ) {
Original file line number Diff line number Diff line change 1616use PhpParser \NodeTraverser ;
1717use PhpParser \NodeVisitor \NameResolver ;
1818use PhpParser \ParserFactory ;
19- use PhpParser \PhpVersion ;
2019
2120trait FormTrait
2221{
@@ -80,7 +79,7 @@ protected function loadParentInterfaces(string $parentFqcn): array
8079 }
8180
8281 /** @phpstan-ignore-next-line */
83- $ parser = (new ParserFactory ())->createForVersion (PhpVersion:: fromString ( ' 8.1 ' ) );
82+ $ parser = (new ParserFactory ())->createForHostVersion ( );
8483 $ code = file_get_contents ($ filePath );
8584 $ stmts = $ parser ->parse ($ code );
8685
You can’t perform that action at this time.
0 commit comments