PhpParser\Node::getAttributes PHP Method

getAttributes() public method

Returns all attributes for the given node.
public getAttributes ( ) : array
return array
    public function getAttributes();

Usage Example

 /**
  * Swap out __DIR__ and __FILE__ constants, because the default ones when
  * calling eval() don't make sense.
  *
  * @param Node $node
  *
  * @return null|FuncCall|StringNode
  */
 public function enterNode(Node $node)
 {
     if ($node instanceof Dir) {
         return new FuncCall(new Name('getcwd'), array(), $node->getAttributes());
     } elseif ($node instanceof File) {
         return new StringNode('', $node->getAttributes());
     }
 }
All Usage Examples Of PhpParser\Node::getAttributes