public function enterNode(Node $node)
    {
        parent::enterNode($node);

        if (self::isConditional($node)) {
            $this->conditionalScopes++;
        } else {
            // @todo add an "else" here which adds a runtime check for instances where we can't tell
            // whether a class is being redefined by static analysis alone.
            if ($this->conditionalScopes === 0) {
                if ($node instanceof Class_) {
                    $this->validateClassStatement($node);
                } elseif ($node instanceof Interface_) {
                    $this->validateInterfaceStatement($node);
                } elseif ($node instanceof Trait_) {
                    $this->validateTraitStatement($node);
                }
            }
        }
    }
public function enterNode(Node $node)
    {
        parent::enterNode($node);

        if (self::isConditional($node)) {
            $this->conditionalScopes++;
        } else {
            // @todo add an "else" here which adds a runtime check for instances where we can't tell
            // whether a class is being redefined by static analysis alone.
            if ($this->conditionalScopes === 0) {
                if ($node instanceof Class_) {
                    $this->validateClassStatement($node);
                } elseif ($node instanceof Interface_) {
                    $this->validateInterfaceStatement($node);
                } elseif ($node instanceof Trait_) {
                    $this->validateTraitStatement($node);
                }
            }
        }
    }
public function enterNode ( Node $ node ) { parent :: enterNode ( $ node ) ; if ( self :: isConditional ( $ node ) ) { $ this -> conditionalScopes ++ ; } else { // @todo add an "else" here which adds a runtime check for instances where we can't tell // whether a class is being redefined by static analysis alone. if ( $ this -> conditionalScopes === 0 ) { if ( $ node instanceof Class_ ) { $ this -> validateClassStatement ( $ node ) ; } elseif ( $ node instanceof Interface_ ) { $ this -> validateInterfaceStatement ( $ node ) ; } elseif ( $ node instanceof Trait_ ) { $ this -> validateTraitStatement ( $ node ) ; } } } }
Validate class, interface and trait definitions.

Validate them upon entering the node, so that we know about their
presence and can validate constant fetches and static calls in class or
trait methods.

@param Node $node
Validate class interface and trait definitions .