src/NodeVisitor.php
private function count(string $type, string $name = null): bool
    {
        assert(isset($this->counts[$type]), 'Expected valid `$type`');

        if (!$name) {
            return false;
        }

        return ($this->counts[$type][$name] = ($this->counts[$type][$name] ?? 0) + 1) === 1;
    }
private function count(string $type, string $name = null): bool
    {
        assert(isset($this->counts[$type]), 'Expected valid `$type`');

        if (!$name) {
            return false;
        }

        return ($this->counts[$type][$name] = ($this->counts[$type][$name] ?? 0) + 1) === 1;
    }
private function count ( string $ type , string $ name = null ) : bool { assert ( isset ( $ this -> counts [ $ type ] ) , 'Expected valid `$type`' ) ; if ( ! $ name ) { return false ; } return ( $ this -> counts [ $ type ] [ $ name ] = ( $ this -> counts [ $ type ] [ $ name ] ?? 0 ) + 1 ) === 1 ; }
Keeps a count of declarations by type and name of node.

@param string $type      One of `array_keys($this->counts)`.
@param string|null $name Name of the node.  Theoretically could be null.

@return bool If true, this is the first declaration of this type with
this name, so it can be safely included.
Keeps a count of declarations by type and name of node .