diff --git a/src/NodeVisitor.php b/src/NodeVisitor.php index f3c52e7..0e631dc 100644 --- a/src/NodeVisitor.php +++ b/src/NodeVisitor.php @@ -426,7 +426,7 @@ function (\PhpParser\Node\Const_ $const) { * @return bool If true, this is the first declaration of this type with * this name, so it can be safely included. */ - private function count(string $type, string $name = null): bool + private function count(string $type, ?string $name = null): bool { assert(isset($this->counts[$type]), 'Expected valid `$type`'); diff --git a/src/Result.php b/src/Result.php index ba3e796..29d6356 100644 --- a/src/Result.php +++ b/src/Result.php @@ -105,7 +105,7 @@ public function getDuplicates(): array * * @return string The pretty printed version. */ - public function prettyPrint(PrettyPrinterAbstract $printer = null): string + public function prettyPrint(?PrettyPrinterAbstract $printer = null): string { if (!$printer) { $printer = new Standard(); diff --git a/src/StubsGenerator.php b/src/StubsGenerator.php index eea0bec..b231485 100644 --- a/src/StubsGenerator.php +++ b/src/StubsGenerator.php @@ -106,11 +106,11 @@ public function __construct(int $symbols = self::DEFAULT, array $config = []) * pretty-printed stubs. * * @param Finder $finder The set of files to generate (merged) stubs for. - * @param NodeVisitor $visitor The optional node visitor to override the default. + * @param NodeVisitor|null $visitor The optional node visitor to override the default. * * @return Result */ - public function generate(Finder $finder, NodeVisitor $visitor = null): Result + public function generate(Finder $finder, ?NodeVisitor $visitor = null): Result { $parser = (new ParserFactory())->createForNewestSupportedVersion();