src/Language/Parser.php
private function parseScalarTypeExtension()
    {
        $start = $this->lexer->token;
        $this->expectKeyword('extend');
        $this->expectKeyword('scalar');
        $name       = $this->parseName();
        $directives = $this->parseDirectives(true);
        if (count($directives) === 0) {
            throw $this->unexpected();
        }

        return new ScalarTypeExtensionNode([
            'name'       => $name,
            'directives' => $directives,
            'loc'        => $this->loc($start),
        ]);
    }
private function parseScalarTypeExtension()
    {
        $start = $this->lexer->token;
        $this->expectKeyword('extend');
        $this->expectKeyword('scalar');
        $name       = $this->parseName();
        $directives = $this->parseDirectives(true);
        if (count($directives) === 0) {
            throw $this->unexpected();
        }

        return new ScalarTypeExtensionNode([
            'name'       => $name,
            'directives' => $directives,
            'loc'        => $this->loc($start),
        ]);
    }
private function parseScalarTypeExtension ( ) { $ start = $ this -> lexer -> token ; $ this -> expectKeyword ( 'extend' ) ; $ this -> expectKeyword ( 'scalar' ) ; $ name = $ this -> parseName ( ) ; $ directives = $ this -> parseDirectives ( true ) ; if ( count ( $ directives ) === 0 ) { throw $ this -> unexpected ( ) ; } return new ScalarTypeExtensionNode ( [ 'name' => $ name , 'directives' => $ directives , 'loc' => $ this -> loc ( $ start ) , ] ) ; }
@return ScalarTypeExtensionNode

@throws SyntaxError
@return ScalarTypeExtensionNode