diff --git a/src/Analyzer/FileParserFactory.php b/src/Analyzer/FileParserFactory.php index e8c3b93f..1755c660 100644 --- a/src/Analyzer/FileParserFactory.php +++ b/src/Analyzer/FileParserFactory.php @@ -9,13 +9,15 @@ class FileParserFactory { - public static function createFileParser(TargetPhpVersion $targetPhpVersion, bool $parseCustomAnnotations = true): FileParser - { + public static function createFileParser( + TargetPhpVersion $targetPhpVersion = null, + bool $parseCustomAnnotations = true + ): FileParser { return new FileParser( new NodeTraverser(), new FileVisitor(new ClassDescriptionBuilder()), new NameResolver(null, ['parseCustomAnnotations' => $parseCustomAnnotations]), - $targetPhpVersion + $targetPhpVersion ?? TargetPhpVersion::create() ); } } diff --git a/src/CLI/TargetPhpVersion.php b/src/CLI/TargetPhpVersion.php index 8ec80100..3f033afb 100644 --- a/src/CLI/TargetPhpVersion.php +++ b/src/CLI/TargetPhpVersion.php @@ -26,7 +26,7 @@ private function __construct(?string $version) $this->version = $version; } - public static function create(?string $version): self + public static function create(string $version = null): self { if (null === $version) { return new self(phpversion());