示例#1
0
 /**
  * Parses Interface node to InterfaceData
  *
  * @return InterfaceData
  */
 public function parse(Interface_ $node, FQN $fqn, $file)
 {
     $fqcn = new FQCN($node->name, $fqn);
     $interface = new InterfaceData($fqcn, $file);
     foreach ($node->extends as $interfaceName) {
         $interface->addInterface($this->useParser->getFQCN($interfaceName));
     }
     foreach ($node->stmts as $child) {
         if ($child instanceof ClassMethod) {
             $interface->addMethod($this->parseMethod($child));
         }
     }
     return $interface;
 }
示例#2
0
 public function addInterface(InterfaceData $interface)
 {
     $this->interfaces[$interface->fqcn->toString()] = $interface;
     foreach ($this->findInterfaceChildrenClasses($interface->fqcn) as $child) {
         $this->addImplement($child, $interface->fqcn);
     }
     foreach ($interface->getInterfaces() as $parent) {
         if ($parent instanceof FQCN) {
             $this->addImplement($interface, $parent);
         }
     }
 }