TypeExtension :
- ScalarTypeExtension
- ObjectTypeExtension
- InterfaceTypeExtension
- UnionTypeExtension
- EnumTypeExtension
- InputObjectTypeDefinition

@return TypeSystemExtensionNodeInterface
@throws SyntaxErrorException
540583
protected function lexTypeSystemExtension(): TypeSystemExtensionNodeInterface
    {
        $token = $this->lexer->lookahead();

        if (TokenKindEnum::NAME === $token->getKind()) {
            switch ($token->getValue()) {
                case KeywordEnum::SCHEMA:
                    return $this->lexSchemaExtension();
                case KeywordEnum::SCALAR:
                    return $this->lexScalarTypeExtension(false);
                case KeywordEnum::TYPE:
                    return $this->lexObjectTypeExtension();
                case KeywordEnum::INTERFACE:
                    return $this->lexInterfaceTypeExtension();
                case KeywordEnum::UNION:
                    return $this->lexUnionTypeExtension();
                case KeywordEnum::ENUM:
                    return $this->lexEnumTypeExtension();
                case KeywordEnum::INPUT:
                    return $this->lexInputObjectTypeExtension();
            }
        }

        throw $this->unexpected($token);
    }
951523
public function getExecOptionsResolver()
    {
        if (null === $this->execOptionsResolver) {
            if (null !== $this->parent) {
                $this->execOptionsResolver = clone $this->parent->getExecOptionsResolver();
            } else {
                $this->execOptionsResolver = new OptionsResolver();
            }

            $this->innerType->setExecOptions($this->execOptionsResolver);

            foreach ($this->typeExtensions as $extension) {
                $extension->setExecOptions($this->execOptionsResolver);
            }
        }

        return $this->execOptionsResolver;
    }
1270128
protected function lexVariableDefinition(): VariableDefinitionNode
    {
        $start = $this->lexer->getToken();

        /**
         * @return TypeNodeInterface
         */
        $parseType = function (): TypeNodeInterface {
            $this->expect(TokenKindEnum::COLON);
            return $this->lexType();
        };

        return new VariableDefinitionNode(
            $this->lexVariable(),
            $parseType(),
            $this->skip(TokenKindEnum::EQUALS)
                ? $this->lexValue(true)
                : null,
            $this->createLocation($start)
        );
    }
104028
protected function lexObjectTypeDefinition(): ObjectTypeDefinitionNode
    {
        $start = $this->lexer->getToken();

        $description = $this->lexDescription();

        $this->expectKeyword(KeywordEnum::TYPE);

        return new ObjectTypeDefinitionNode(
            $description,
            $this->lexName(),
            $this->lexImplementsInterfaces(),
            $this->lexDirectives(),
            $this->lexFieldsDefinition(),
            $this->createLocation($start)
        );
    }
337560
public function getExtendedType()
    {
        if (!method_exists($this, 'getExtendedTypes')) {
            throw new LogicException(sprintf('You need to implement the static getExtendedTypes() method when implementing the %s in %s.', FormTypeExtensionInterface::class, static::class));
        }

        @trigger_error(sprintf('The %s::getExtendedType() method is deprecated since Symfony 4.2 and will be removed in 5.0. Use getExtendedTypes() instead.', \get_class($this)), E_USER_DEPRECATED);

        foreach (static::getExtendedTypes() as $extendedType) {
            return $extendedType;
        }
    }
620319
protected function lexInterfaceTypeDefinition(): InterfaceTypeDefinitionNode
    {
        $start = $this->lexer->getToken();

        $description = $this->lexDescription();

        $this->expectKeyword(KeywordEnum::INTERFACE);

        return new InterfaceTypeDefinitionNode(
            $description,
            $this->lexName(),
            $this->lexDirectives(),
            $this->lexFieldsDefinition(),
            $this->createLocation($start)
        );
    }
1193722
public function conditionalExpression()
    {
        $conditionalTerms = array();
        $conditionalTerms[] = $this->conditionalTerm();

        while ($this->lexer->isNextToken(Lexer::T_OR)) {
            $this->match(Lexer::T_OR);

            $conditionalTerms[] = $this->conditionalTerm();
        }

        // Phase 1 AST optimization: Prevent AST\ConditionalExpression
        // if only one AST\ConditionalTerm is defined
        if (count($conditionalTerms) == 1) {
            return $conditionalTerms[0];
        }

        return new ConditionalExpressionNode($conditionalTerms);
    }
733948
private function initTypeExtensions()
    {
        $this->typeExtensions = [];

        foreach ($this->loadTypeExtensions() as $extension) {
            if (!$extension instanceof BlockTypeExtensionInterface) {
                throw new UnexpectedTypeException($extension, 'Fxp\Component\Block\BlockTypeExtensionInterface');
            }

            foreach ($extension::getExtendedTypes() as $extendedType) {
                $this->typeExtensions[$extendedType][] = $extension;
            }
        }
    }
914445
public function extension($idExtension): ExtensionInterface
    {
        if ($this->hasExtension($idExtension) !== true) {
            throw new \OutOfBoundsException(sprintf('Extension "%s" not found.', $idExtension));
        }

        return $this->extensions[$idExtension];
    }
1038886
def parse_object_type_extension(lexer: Lexer) -> Node:
    """"""
    start = lexer.token
    expect_keyword(lexer, "extend")
    expect_keyword(lexer, "type")
    name = parse_name(lexer)
    interfaces = parse_implements_interfaces(lexer)
    directives = parse_directives(lexer, True)
    fields = parse_fields_definition(lexer)
    if not (interfaces or directives or fields):
        raise unexpected(lexer)
    return Node(
        name=name,
        interfaces=interfaces,
        directives=directives,
        fields=fields,
        loc=loc(lexer, start),
    )
1008879
protected function parseType()
    {
        $start = $this->token->getStart();

        if ($this->skip(Token::BRACKET_L_TYPE)) {
            $type = $this->parseType();
            $this->expect(Token::BRACKET_R_TYPE);
            $type = new ListType($type, $this->location($start));
        } else {
            $type = $this->parseNamedType();
        }

        if ($this->skip(Token::BANG_TYPE)) {
            return new NonNullType($type, $this->location($start));
        }

        return $type;
    }
1312704
protected function lexInputValueDefinition(): InputValueDefinitionNode
    {
        $start = $this->lexer->getToken();

        $description = $this->lexDescription();
        $name        = $this->lexName();

        $this->expect(TokenKindEnum::COLON);

        return new InputValueDefinitionNode(
            $description,
            $name,
            $this->lexType(),
            $this->skip(TokenKindEnum::EQUALS)
                ? $this->lexValue(true)
                : null,
            $this->lexDirectives(true),
            $this->createLocation($start)
        );
    }
637038
public function NewObjectArg()
    {
        $token = $this->lexer->lookahead;
        $peek  = $this->lexer->glimpse();

        if ($token['type'] === Lexer::T_OPEN_PARENTHESIS && $peek['type'] === Lexer::T_SELECT) {
            $this->match(Lexer::T_OPEN_PARENTHESIS);
            $expression = $this->Subselect();
            $this->match(Lexer::T_CLOSE_PARENTHESIS);

            return $expression;
        }

        return $this->ScalarExpression();
    }
34697
public function build(): GetComputedStyleForNodeRequest
	{
		$instance = new GetComputedStyleForNodeRequest();
		if ($this->nodeId === null) {
			throw new BuilderException('Property [nodeId] is required.');
		}
		$instance->nodeId = $this->nodeId;
		return $instance;
	}
353964
protected function resolveType(TypeDefinitionNode $typeDefinition): Type
    {
        // Ignore TypeExtensionNode since they are merged before we get here
        switch (get_class($typeDefinition)) {
            case EnumTypeDefinitionNode::class:
                return $this->resolveEnumType($typeDefinition);
            case ScalarTypeDefinitionNode::class:
                return $this->resolveScalarType($typeDefinition);
            case ObjectTypeDefinitionNode::class:
                return $this->resolveObjectType($typeDefinition);
            case InputObjectTypeDefinitionNode::class:
                return $this->resolveInputObjectType($typeDefinition);
            case InterfaceTypeDefinitionNode::class:
                return $this->resolveInterfaceType($typeDefinition);
            case UnionTypeDefinitionNode::class:
                return $this->resolveUnionType($typeDefinition);
            default:
                throw new InvariantViolation(
                    "Unknown type for definition [{$typeDefinition->name->value}]"
                );
        }
    }
789216
private function constDeclaration() {
    $node = new ConstantDeclarationNode();
    $name_node = new NameNode();
    $this->mustMatch(T_STRING, $name_node, NULL, TRUE);
    $node->addChild($name_node, 'name');
    if ($this->mustMatch('=', $node)) {
      $node->addChild($this->staticScalar(), 'value');
    }
    return $node;
  }
161240
private function initFilterTypeExtensions()
    {
        $this->filterTypeExtensions = [];

        foreach ($this->loadFilterTypeExtensions() as $extension) {
            if (!$extension instanceof FilterTypeExtensionInterface) {
                throw new UnexpectedTypeException($extension, FilterTypeExtensionInterface::class);
            }

            $type = $extension->getExtendedType();

            $this->filterTypeExtensions[$type][] = $extension;
        }
    }