<commit_before><?php

namespace Fubhy\GraphQL\Type\Definition\Types;

/**
 * List Modifier.
 *
 * A list is a kind of type marker, a wrapping type which points to another
 * type. Lists are often created within the context of defining the fields of an
 * object type.
 */
class ListModifier extends Type implements
    TypeInterface,
    InputTypeInterface,
    OutputTypeInterface,
    NullableTypeInterface,
    ModifierInterface
{
    /**
     * @var \Fubhy\GraphQL\Type\Definition\Types\TypeInterface
     */
    protected $ofType;

    /**
     * @param callable|\Fubhy\GraphQL\Type\Definition\Types\TypeInterface $ofType
     */
    public function __construct($ofType)
    {
        if (!($ofType instanceof TypeInterface) && !is_callable($ofType)) {
            throw new \LogicException('Expected callable or instance of \Fubhy\GraphQL\Type\Definition\Types\TypeInterface.');
        }

        $this->ofType = $ofType;
    }

    /**
     * @return \Fubhy\GraphQL\Type\Definition\Types\TypeInterface
     */
    public function getWrappedType()
    {
        if (is_callable($this->ofType)) {
            return call_user_func($this->ofType);
        }

        return $this->ofType;
    }

    /**
     * {@inheritdoc}
     */
    public function getName()
    {
        return '[' . (string) $this->ofType . ']';
    }

    /**
     * {@inheritdoc}
     */
    public function getDescription()
    {
        return NULL;
    }

    /**
     * {@inheritdoc}
     */
    public function __toString()
    {
        return $this->getName();
    }
}
<commit_msg>Allow list modifier to have its wrapped type  resolved lazily.<commit_after><?php

namespace Fubhy\GraphQL\Type\Definition\Types;

/**
 * List Modifier.
 *
 * A list is a kind of type marker, a wrapping type which points to another
 * type. Lists are often created within the context of defining the fields of an
 * object type.
 */
class ListModifier extends Type implements
    TypeInterface,
    InputTypeInterface,
    OutputTypeInterface,
    NullableTypeInterface,
    ModifierInterface
{
    /**
     * @var \Fubhy\GraphQL\Type\Definition\Types\TypeInterface
     */
    protected $ofType;

    /**
     * @param callable|\Fubhy\GraphQL\Type\Definition\Types\TypeInterface $ofType
     */
    public function __construct($ofType)
    {
        if (!($ofType instanceof TypeInterface) && !is_callable($ofType)) {
            throw new \LogicException('Expected callable or instance of \Fubhy\GraphQL\Type\Definition\Types\TypeInterface.');
        }

        $this->ofType = $ofType;
    }

    /**
     * @return \Fubhy\GraphQL\Type\Definition\Types\TypeInterface
     */
    public function getWrappedType()
    {
        if (is_callable($this->ofType)) {
            return call_user_func($this->ofType);
        }

        return $this->ofType;
    }

    /**
     * {@inheritdoc}
     */
    public function getName()
    {
        return '[' . (string) $this->getWrappedType() . ']';
    }

    /**
     * {@inheritdoc}
     */
    public function getDescription()
    {
        return NULL;
    }

    /**
     * {@inheritdoc}
     */
    public function __toString()
    {
        return $this->getName();
    }
}

{'fraction_non_alphanumeric': 0.1223021582733813, 'fraction_numerical': 0.0, 'mean_word_length': 2.276639344262295, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 15, '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': '5205739', 'n_tokens_mistral': 959, 'n_tokens_neox': 945, 'n_words': 211}