private function findClassInPath(string
$path, string
$class, string
$prefix): array
{ if (!
$path =
realpath($path.'/'.
strtr($prefix, '\\_', '//'
)) ?:
realpath($path.'/'.\
dirname(strtr($prefix, '\\_', '//'
))) ?:
realpath($path)) { return [];
} $classes =
[];
$filename =
$class.'.php';
foreach (new \
RecursiveIteratorIterator(new \
RecursiveDirectoryIterator($path, \RecursiveDirectoryIterator::SKIP_DOTS
), \RecursiveIteratorIterator::LEAVES_ONLY
) as $file) { if ($filename ==
$file->
getFileName() &&
$class =
$this->
convertFileToClass($path,
$file->
getPathName(),
$prefix)) { $classes[] =
$class;
} } return $classes;
} private function convertFileToClass(string
$path, string
$file, string
$prefix): ?string
{ $candidates =
[ // namespaced class