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 26305e7..b6222aa 100644 --- a/src/PhpFileCleaner.php +++ b/src/PhpFileCleaner.php @@ -241,7 +241,7 @@ private function peek(string $char): bool * @param null|array $match * @param-out array $match */ - private function match(string $regex, array &$match = null): bool + private function match(string $regex, ?array &$match = null): bool { return Preg::isMatchStrictGroups($regex, $this->contents, $match, 0, $this->index); }