示例#1
0
 public static function buildFilename(SplFileInfo $fileInfo)
 {
     $defs = $fileInfo->getReader()->getDefinitionNames();
     if (isset($defs[0])) {
         return $defs[0] . '.php';
     }
     return $fileInfo->getFileName();
 }
示例#2
0
 /**
  * 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;
         }
     }
 }
示例#3
0
 /**
  * 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();
         }
     }
 }