diff --git a/src/ClassMapGenerator.php b/src/ClassMapGenerator.php index fd905c3..53f9a42 100644 --- a/src/ClassMapGenerator.php +++ b/src/ClassMapGenerator.php @@ -61,7 +61,7 @@ public function __construct(array $extensions = ['php', 'inc']) * * @return $this */ - public function avoidDuplicateScans(FileList $scannedFiles = null): self + public function avoidDuplicateScans(?FileList $scannedFiles = null): self { $this->scannedFiles = $scannedFiles ?? new FileList; @@ -100,7 +100,7 @@ public function getClassMap(): ClassMap * * @throws \RuntimeException When the path is neither an existing file nor directory */ - public function scanPaths($path, string $excluded = null, string $autoloadType = 'classmap', ?string $namespace = null): void + public function scanPaths($path, ?string $excluded = null, string $autoloadType = 'classmap', ?string $namespace = null): void { if (!in_array($autoloadType, ['psr-0', 'psr-4', 'classmap'], true)) { throw new \InvalidArgumentException('$autoloadType must be one of: "psr-0", "psr-4" or "classmap"'); diff --git a/src/PhpFileCleaner.php b/src/PhpFileCleaner.php index 3a74478..7c0f72a 100644 --- a/src/PhpFileCleaner.php +++ b/src/PhpFileCleaner.php @@ -240,7 +240,7 @@ private function peek(string $char): bool * @param non-empty-string $regex * @param null|array $match */ - private function match(string $regex, array &$match = null): bool + private function match(string $regex, ?array &$match = null): bool { return Preg::isMatch($regex, $this->contents, $match, 0, $this->index); }