<commit_before><?php

declare(strict_types=1);

namespace GraphQL\Type\Definition;

use GraphQL\Error\Error;
use GraphQL\Error\InvariantViolation;
use GraphQL\Language\AST\EnumTypeDefinitionNode;
use GraphQL\Language\AST\EnumValueNode;
use GraphQL\Language\AST\Node;
use GraphQL\Utils\MixedStore;
use GraphQL\Utils\Utils;
use function is_array;
use function is_int;
use function is_string;
use function sprintf;

/**
 * Class EnumType
 */
class EnumType extends Type implements InputType, OutputType, LeafType, NamedType
{
    /** @var EnumTypeDefinitionNode|null */
    public $astNode;

    /** @var EnumValueDefinition[] */
    private $values;

    /** @var MixedStore<mixed, EnumValueDefinition> */
    private $valueLookup;

    /** @var \ArrayObject<string, EnumValueDefinition> */
    private $nameLookup;

    public function __construct($config)
    {
        if (! isset($config['name'])) {
            $config['name'] = $this->tryInferName();
        }

        Utils::invariant(is_string($config['name']), 'Must provide name.');

        $this->name        = $config['name'];
        $this->description = $config['description'] ?? null;
        $this->astNode     = $config['astNode'] ?? null;
        $this->config      = $config;
    }

    /**
     * @param string|mixed[] $name
     * @return EnumValueDefinition|null
     */
    public function getValue($name)<commit_msg>TASK: Allow EnumType extensions<commit_after><?php

declare(strict_types=1);

namespace GraphQL\Type\Definition;

use GraphQL\Error\Error;
use GraphQL\Error\InvariantViolation;
use GraphQL\Language\AST\EnumTypeDefinitionNode;
use GraphQL\Language\AST\EnumTypeExtensionNode;
use GraphQL\Language\AST\EnumValueNode;
use GraphQL\Language\AST\Node;
use GraphQL\Utils\MixedStore;
use GraphQL\Utils\Utils;
use function is_array;
use function is_int;
use function is_string;
use function sprintf;

/**
 * Class EnumType
 */
class EnumType extends Type implements InputType, OutputType, LeafType, NamedType
{
    /** @var EnumTypeDefinitionNode|null */
    public $astNode;

    /** @var EnumValueDefinition[] */
    private $values;

    /** @var MixedStore<mixed, EnumValueDefinition> */
    private $valueLookup;

    /** @var \ArrayObject<string, EnumValueDefinition> */
    private $nameLookup;

    /** @var EnumTypeExtensionNode[] */
    public $extensionASTNodes;

    public function __construct($config)
    {
        if (! isset($config['name'])) {
            $config['name'] = $this->tryInferName();
        }

        Utils::invariant(is_string($config['name']), 'Must provide name.');

        $this->name              = $config['name'];
        $this->description       = $config['description'] ?? null;
        $this->astNode           = $config['astNode'] ?? null;
        $this->extensionASTNodes = $config['extensionASTNodes'] ?? null;
        $this->config            = $config;
    }

    /**
     * @param string|mixed[] $name
     * @return EnumValueDefinition|null
     */
    public function getValue($name)
{'fraction_non_alphanumeric': 0.13764510779436154, 'fraction_numerical': 0.0006633499170812604, 'mean_word_length': 3.320916905444126, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 18, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6591357', 'n_tokens_mistral': 897, 'n_tokens_neox': 876, 'n_words': 187}