public function getFullStart() : int {
        foreach($this::CHILD_NAMES as $name) {

            if (($child = $this->$name) !== null) {

                if (\is_array($child)) {
                    if(!isset($child[0])) {
                        continue;
                    }
                    $child = $child[0];
                }

                if ($child instanceof Node) {
                    return $child->getFullStart();
                }

                if ($child instanceof Token) {
                    return $child->fullStart;
                }

                throw new \Exception("Unknown type in AST: " . \gettype($child));
            }
        };

        throw new \RuntimeException("Could not resolve full start position");
    }
public function getFullStart() : int {
        foreach($this::CHILD_NAMES as $name) {

            if (($child = $this->$name) !== null) {

                if (\is_array($child)) {
                    if(!isset($child[0])) {
                        continue;
                    }
                    $child = $child[0];
                }

                if ($child instanceof Node) {
                    return $child->getFullStart();
                }

                if ($child instanceof Token) {
                    return $child->fullStart;
                }

                throw new \Exception("Unknown type in AST: " . \gettype($child));
            }
        };

        throw new \RuntimeException("Could not resolve full start position");
    }
public function getFullStart ( ) : int { foreach ( $ this :: CHILD_NAMES as $ name ) { if ( ( $ child = $ this -> $ name ) !== null ) { if ( \ is_array ( $ child ) ) { if ( ! isset ( $ child [ 0 ] ) ) { continue ; } $ child = $ child [ 0 ] ; } if ( $ child instanceof Node ) { return $ child -> getFullStart ( ) ; } if ( $ child instanceof Token ) { return $ child -> fullStart ; } throw new \ Exception ( "Unknown type in AST: " . \ gettype ( $ child ) ) ; } } ; throw new \ RuntimeException ( "Could not resolve full start position" ) ; }
Gets start position of Node, including leading comments and whitespace
@return int
@throws \Exception
Gets start position of Node including leading comments and whitespace