use PhpParser\Node\Expr\ConstFetch;
use PhpParser\Node\Expr\FuncCall;
use PhpParser\Node\Name;
-use PhpParser\Node\Stmt\Class_ as ClassStmt;
-use PhpParser\Node\Stmt\Trait_ as TraitStmt;
+use PhpParser\Node\Stmt\Class_;
+use PhpParser\Node\Stmt\Trait_;
use Psy\Exception\ErrorException;
/**
*/
public function enterNode(Node $node)
{
- if ($node instanceof ClassStmt || $node instanceof TraitStmt) {
+ if ($node instanceof Class_ || $node instanceof Trait_) {
$this->inClass = true;
} elseif ($node instanceof FuncCall && !$this->inClass) {
// We'll give any args at all (besides null) a pass.
// Technically we should be checking whether the args are objects, but this will do for now.
//
- // TODO: switch this to actually validate args when we get context-aware code cleaner passes.
+ // @todo switch this to actually validate args when we get context-aware code cleaner passes.
if (!empty($node->args) && !$this->isNull($node->args[0])) {
return;
}
*/
public function leaveNode(Node $node)
{
- if ($node instanceof ClassStmt) {
+ if ($node instanceof Class_) {
$this->inClass = false;
}
}