public static function buildFilename(SplFileInfo $fileInfo) { $defs = $fileInfo->getReader()->getDefinitionNames(); if (isset($defs[0])) { return $defs[0] . '.php'; } return $fileInfo->getFileName(); }
/** * Scan filesystem for classes, interfaces and traits * * @param Finder $finder */ public function __construct(Finder $finder) { /** @var \Symfony\Component\Finder\SplFileInfo $fileInfo */ foreach ($finder as $fileInfo) { $fileInfo = new SplFileInfo($fileInfo); foreach ($fileInfo->getReader()->getDefinitionNames() as $name) { $this->classMap[$name] = $fileInfo; } } }
/** * Scan filesystem for classes, interfaces and traits * * @param Finder $finder */ public function __construct(Finder $finder) { /** @var \Symfony\Component\Finder\SplFileInfo $fileInfo */ foreach ($finder as $fileInfo) { $fileInfo = new SplFileInfo($fileInfo); try { foreach ($fileInfo->getReader()->getDefinitionNames() as $name) { $this->classMap[$name] = $fileInfo; } } catch (ReaderException $exception) { $this->errors[] = $exception->getMessage(); } } }