Пример #1
0
 /**
  * @dataProvider provideClasses
  */
 public function testParse($class, $import, $expected)
 {
     /** @noinspection PhpIncludeInspection */
     require_once __DIR__ . '/resources/' . $import . '.php';
     $rClass = new ReflectionClass($class);
     $parser = new PhpParser();
     $this->assertEquals($expected, $parser->parseClass($rClass));
 }
Пример #2
0
 /**
  * @param \Reflection|\ReflectionMethod|\ReflectionProperty $rThing
  * @return array
  */
 protected function _getDeclaredNamespaces($rThing)
 {
     /**
      * @var \ReflectionClass $dClass
      */
     $dClass = $rThing->getDeclaringClass();
     if ($dClass != $this->class) {
         $fullName = $dClass->getNamespaceName() . '\\' . $dClass->getName();
         if (!isset($this->otherNamespaces[$fullName])) {
             $this->otherNamespaces[$fullName] = $this->nsParser->parseClass($dClass);
         }
         return $this->otherNamespaces[$fullName];
     }
     return $this->_getNamespaces();
 }