leaveNode() публичный Метод

{@inheritDoc}
public leaveNode ( PHPParser_Node $node )
$node PHPParser_Node
Пример #1
0
 /**
  * {@inheritDoc}
  */
 public function leaveNode(\PHPParser_Node $node)
 {
     if ($node->getType() === 'Stmt_Class') {
         if ($this->newInterface) {
             $this->newContent[] = $this->buildNewInterface();
         }
         $this->newInterface = false;
     }
     parent::leaveNode($node);
 }
Пример #2
0
 /**
  * {@inheritdoc}
  */
 public function leaveNode(\PHPParser_Node $node)
 {
     switch ($node->getType()) {
         case 'Stmt_ClassMethod':
             $this->currentMethodRelevant = false;
             break;
         case 'Stmt_Class':
             // generate
             foreach ($this->factoryMethodStack as $name => $calling) {
                 $factory = new \PHPParser_Node_Stmt_ClassMethod($name);
                 $factory->type = \PHPParser_Node_Stmt_Class::MODIFIER_PROTECTED;
                 $factory->params = $this->getProcessedArgument($calling->args);
                 $class = $calling->getAttribute('classShortcut');
                 $factory->stmts = array(new \PHPParser_Node_Stmt_Return(new \PHPParser_Node_Expr_New(new \PHPParser_Node_Name($class), $factory->params)));
                 $this->currentClassStmts[] = $factory;
             }
             break;
     }
     return parent::leaveNode($node);
 }