Add Node property overloads for accessing attributes
Node attributes are now also accessible as ordinary properties. Accessing an undefined attribute throws -- the getAttribute() default value behavior can be replicated using coalescing. @property declarations for all the standard attributes have been added to the relevant nodes. Of course, whether they are actually available depends on configuration.
Showing
- lib/PhpParser/Node.php 56 additions, 0 deletionslib/PhpParser/Node.php
- lib/PhpParser/Node/Const_.php 4 additions, 0 deletionslib/PhpParser/Node/Const_.php
- lib/PhpParser/Node/Expr/Array_.php 3 additions, 0 deletionslib/PhpParser/Node/Expr/Array_.php
- lib/PhpParser/Node/Expr/Exit_.php 3 additions, 0 deletionslib/PhpParser/Node/Expr/Exit_.php
- lib/PhpParser/Node/Scalar/Encapsed.php 4 additions, 0 deletionslib/PhpParser/Node/Scalar/Encapsed.php
- lib/PhpParser/Node/Scalar/LNumber.php 3 additions, 0 deletionslib/PhpParser/Node/Scalar/LNumber.php
- lib/PhpParser/Node/Scalar/String_.php 4 additions, 0 deletionslib/PhpParser/Node/Scalar/String_.php
- lib/PhpParser/Node/Stmt/ClassLike.php 3 additions, 0 deletionslib/PhpParser/Node/Stmt/ClassLike.php
- lib/PhpParser/Node/Stmt/Function_.php 3 additions, 0 deletionslib/PhpParser/Node/Stmt/Function_.php
- lib/PhpParser/Node/Stmt/InlineHTML.php 3 additions, 0 deletionslib/PhpParser/Node/Stmt/InlineHTML.php
- lib/PhpParser/NodeAbstract.php 21 additions, 0 deletionslib/PhpParser/NodeAbstract.php
- lib/PhpParser/NodeVisitor/NameResolver.php 3 additions, 3 deletionslib/PhpParser/NodeVisitor/NameResolver.php
- test/PhpParser/NodeAbstractTest.php 25 additions, 6 deletionstest/PhpParser/NodeAbstractTest.php
Please register or sign in to comment