Ejemplo n.º 1
0
 /**
  * Parse a constant declaration.
  * @return ConstantDeclarationNode
  */
 private function constDeclaration()
 {
     $node = new ConstantDeclarationNode();
     $name_node = new NameNode();
     $this->mustMatch(T_STRING, $name_node, NULL, TRUE);
     $node->addChild($name_node, 'name');
     if ($this->mustMatch('=', $node)) {
         $node->addChild($this->staticScalar(), 'value');
     }
     return $node;
 }
Ejemplo n.º 2
0
 /**
  * Determine if the node belongs to this namespace.
  *
  * @param ClassNode|InterfaceNode|TraitNode|FunctionDeclarationNode|ConstantDeclarationNode $node
  *   Node to test if owned by namespace.
  *
  * @return bool
  */
 public function owns($node)
 {
     return $this === $node->getName()->getNamespace();
 }