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

        return new EnumTypeExtensionNode([
            'name'       => $name,
            'directives' => $directives,
            'values'     => $values,
            'loc'        => $this->loc($start),
        ]);
    }
private function parseEnumTypeExtension()
    {
        $start = $this->lexer->token;
        $this->expectKeyword('extend');
        $this->expectKeyword('enum');
        $name       = $this->parseName();
        $directives = $this->parseDirectives(true);
        $values     = $this->parseEnumValuesDefinition();
        if (count($directives) === 0 &&
            count($values) === 0
        ) {
            throw $this->unexpected();
        }

        return new EnumTypeExtensionNode([
            'name'       => $name,
            'directives' => $directives,
            'values'     => $values,
            'loc'        => $this->loc($start),
        ]);
    }
private function parseEnumTypeExtension ( ) { $ start = $ this -> lexer -> token ; $ this -> expectKeyword ( 'extend' ) ; $ this -> expectKeyword ( 'enum' ) ; $ name = $ this -> parseName ( ) ; $ directives = $ this -> parseDirectives ( true ) ; $ values = $ this -> parseEnumValuesDefinition ( ) ; if ( count ( $ directives ) === 0 && count ( $ values ) === 0 ) { throw $ this -> unexpected ( ) ; } return new EnumTypeExtensionNode ( [ 'name' => $ name , 'directives' => $ directives , 'values' => $ values , 'loc' => $ this -> loc ( $ start ) , ] ) ; }
@return EnumTypeExtensionNode

@throws SyntaxError
@return EnumTypeExtensionNode