Esempio n. 1
0
 /**
  * @param string $file file path
  * @return \ReflectionClass
  */
 public static function getClass($file)
 {
     $file = (string) $file;
     if (!static::$classes) {
         static::$classes = new ArrayCollection();
     }
     if (!static::$classes->get($file)) {
         $name = ReflectionManager::getClassName($file);
         static::$classes->set($file, new \ReflectionClass($name));
     }
     return static::$classes->get($file);
 }
Esempio n. 2
0
 /**
  * Returns an Iterator for the current ClassFinder configuration.
  *
  * @return \Iterator An iterator
  */
 public function getIterator()
 {
     if ($this->useDefaultName && !$this->isDefaultSet) {
         $this->finder->name('*.php');
         $this->isDefaultSet = true;
     }
     $it = $this->finder->getIterator();
     $it = new MapIteratorWrapper($it, array(ReflectionManager::className(), 'getClass'));
     foreach ($this->maps as $map) {
         $it = new MapIteratorWrapper($it, $map);
     }
     return $it;
 }