foundInGlob($path); $absolutePathsFound = \array_merge($absolutePathsFound, $foundPaths); } else { $absolutePathsFound[] = $path; } } return $absolutePathsFound; } /** * @return string[] */ private function foundInGlob(string $path) : array { /** @var string[] $paths */ $paths = (array) \glob($path); return \array_filter($paths, static function (string $path) : bool { return \file_exists($path); }); } }