@param \Spryker\Zed\CodeGenerator\Business\GeneratorProjectTypeResolver\GeneratorProjectTypeResolverInterface $typeResolver

@return string
6212
public function getProviderNameSpace(GeneratorProjectTypeResolverInterface $typeResolver): string
    {
        if ($typeResolver->isDemoShop()) {
            return $this->getDemoShopProviderNamespace();
        }

        return $this->getSuitProviderNamespace();
    }
271520
public static function generate(array $typeFields): array
    {
        $arguments = [];

        foreach ($typeFields as $fieldName => $field) {
            $config = $field->config;

            $required =  isset($config['generator-required']) ? ($config['generator-required'] ? '!' : '') : '';
            $className = get_class($field);
            if ($className !== ObjectType::class) {
                continue;
            }

            $arguments[] = sprintf('%s_id: ID%s', $fieldName, $required);
        }

        return $arguments;
    }
485461
public function configureOptions(OptionsResolver $resolver)
    {
        $this->fixDoctrineQueryBuilderNormalizer($resolver);

        $queryBuilder = function (EntityRepository $repository, $options) {
            $qb = $repository->createQueryBuilder('d');
            if (!empty($options['allowed_families'])) {
                /** @var FamilyInterface[] $families */
                $families = $options['allowed_families'];
                $familyCodes = [];
                foreach ($families as $family) {
                    $familyCodes[] = $family->getCode();
                }

                $qb
                    ->andWhere('d.family IN (:allowedFamilies)')
                    ->setParameter('allowedFamilies', $familyCodes);
            }
            $qb->setMaxResults($options['max_results']);

            return $qb;
        };

        $resolver->setDefaults(
            [
                'em' => $this->entityManager,
                'class' => $this->dataClass,
                'query_builder' => $queryBuilder,
                'max_results' => 100,
            ]
        );

        $this->allowedFamiliesOptionConfigurator->configureOptions($resolver);
    }
271191
private function getIdGenerator($type)
    {
        if (!isset($this->idGenerators[$type])) {
            $this->idGenerators[$type] = IdGenerator::create($type);
        }

        return $this->idGenerators[$type];
    }
429671
public function configureOptions(OptionsResolver $resolver)
    {
        $multiLanguagesChoiceManage = $this->multiLanguagesChoiceManager;
        $resolver->setDefaults(
            array(
                'multiple' => true,
                'expanded' => true,
                'required' => false,
                'class' => $this->workflowFunctionClass,
                'choice_label' => function (WorkflowFunctionInterface $choice) use ($multiLanguagesChoiceManage) {
                    return $multiLanguagesChoiceManage->choose($choice->getNames());
                },
            )
        );
    }
653328
private function getSymbolTableVariableResolver(Configuration $configuration)
    {
        $composedResolver = new ComposedResolver();
        $composedResolver->addResolver(new ArgumentResolver($this->symbolTable));
        $composedResolver->addResolver(new ReattachStateToVariable($this->symbolTable));
        $composedResolver->addResolver(new ReattachStateToProperty($this->symbolTable));
        $composedResolver->addResolver(new VariableAssignResolver($this->symbolTable));
        $composedResolver->addResolver(new PropertyAssignResolver($this->symbolTable));

        /* @TODO: only load the container if the project is a symfony project */
        $containerReader = new ContainerReader();
        $containerReader->loadContainer($configuration->containerPath());
        $composedResolver->addResolver(new SymfonyResolver($this->symbolTable, $containerReader));

        return $composedResolver;
    }
404710
public static function generate(string $typeName, array $typeFields): string
    {
        $arguments = [];

        foreach ($typeFields as $fieldName => $field) {
            $className = get_class($field);
            // We can generate queries for all but Object types, as Object types are relations
            if (! in_array($className, self::$supportedGraphQLTypes)) {
                continue;
            }

            if ($field instanceof FullTextSearch) {
                $arguments[] = sprintf('%s: %s @fulltext', $fieldName, $field->name);
                continue;
            }

            // Add all our custom directives
            $arguments[] = sprintf('%s: %s @eq', $fieldName, $field->name);
            $arguments[] = sprintf('%s_not: %s @not', $fieldName, $field->name);
            $arguments[] = sprintf('%s_in: [%s] @in', $fieldName, $field->name);
            $arguments[] = sprintf('%s_not_in: [%s] @not_in', $fieldName, $field->name);

            if ($field instanceof EnumType) {
                continue;
            }

            if ($field instanceof StringType) {
                $arguments[] = sprintf('%s_contains: %s @contains', $fieldName, $field->name);
                $arguments[] = sprintf('%s_not_contains: %s @not_contains', $fieldName, $field->name);
                $arguments[] = sprintf('%s_starts_with: %s @starts_with', $fieldName, $field->name);
                $arguments[] = sprintf('%s_not_starts_with: %s @not_starts_with', $fieldName, $field->name);
                $arguments[] = sprintf('%s_ends_with: %s @not_ends_with', $fieldName, $field->name);

                continue;
            }


            $arguments[] = sprintf('%s_lt: %s @lt', $fieldName, $field->name);
            $arguments[] = sprintf('%s_lte: %s @lte', $fieldName, $field->name);
            $arguments[] = sprintf('%s_gt: %s @gt', $fieldName, $field->name);
            $arguments[] = sprintf('%s_gte: %s @gte', $fieldName, $field->name);
        }

        if (count($arguments) < 1) {
            return '';
        }

        $allQueryName = str_plural(lcfirst($typeName));
        $queryArguments = sprintf('(%s)', implode(', ', $arguments));
        $allQuery = sprintf('    %1$s%2$s: [%3$s]! @all(model: "%3$s")', $allQueryName, $queryArguments, $typeName);

        $paginatedQueryName = str_plural(lcfirst($typeName)) . 'Paginated';
        $paginatedQuery = sprintf('    %1$s%2$s: [%3$s]! @paginate(model: "%3$s")', $paginatedQueryName, $queryArguments, $typeName);

        if (config('lighthouse-utils.authorization')) {
            $allPermission = sprintf('All%1$s', str_plural($typeName));
            $allQuery .= sprintf(' @can(if: "%1$s", model: "User")', $allPermission);

            $paginatePermission = sprintf('paginate%1$s', str_plural($typeName));
            $paginatedQuery .= sprintf(' @can(if: "%1$s", model: "User")', $paginatePermission);

            GraphQLSchema::register($allQueryName, $typeName, 'query', $allPermission ?? null);
            GraphQLSchema::register($paginatedQueryName, $typeName, 'query', $paginatePermission ?? null);
        }


        return $allQuery ."\r\n". $paginatedQuery;
    }
947250
private function getOptionsResolver()
    {
        // TODO Use/Merge ConfigurationBuilder options resolver.
        if (!$this->optionsResolver) {
            $resolver = new OptionsResolver();

            $resolver
                ->setRequired(['namespace', 'id', 'classes'])
                ->setDefaults([
                    'name'        => function (Options $options) {
                        return Inflector::camelize($options['id']);
                    },
                    'parent_id'   => null,
                    'event'       => null,
                    'templates'   => null,
                    'translation' => null,
                ])
                ->setAllowedTypes('namespace', 'string')
                ->setAllowedTypes('id', 'string')
                ->setAllowedTypes('name', 'string')
                ->setAllowedTypes('parent_id', ['null', 'string'])
                ->setAllowedTypes('classes', 'array')
                ->setAllowedTypes('event', ['null', 'string', 'array'])
                ->setAllowedTypes('templates', ['null', 'string', 'array'])
                ->setAllowedTypes('translation', ['null', 'array']);


            // Classes option
            $classesResolver = new OptionsResolver();
            $classesResolver
                ->setRequired(['entity'])
                ->setDefaults([
                    'form_type'  => null, // @TODO/WARNING no longer required (behavior refactoring)
                    'repository' => null,
                ])
                ->setAllowedTypes('entity', 'string')
                ->setAllowedTypes('repository', ['null', 'string'])
                ->setAllowedTypes('form_type', ['null', 'string']); // @TODO/WARNING no longer required (behavior refactoring)

            $resolver
                ->setNormalizer('classes', function (Options $options, $value) use ($classesResolver) {
                    foreach ($value as $class) {
                        if ($class && !class_exists($class)) {
                            throw new InvalidOptionsException(sprintf("Class '%s' does not exists.", $class));
                        }
                    }

                    $entity = $value['entity'];
                    if (null !== $options['translation'] && !is_subclass_of($entity, TranslatableInterface::class)) {
                        throw new InvalidOptionsException(sprintf(
                            "Class '%s' must implements '%s'.",
                            $entity,
                            TranslatableInterface::class));
                    }

                    $repository = array_key_exists('repository', $value) ? $value['repository'] : null;
                    if (null === $repository) {
                        $value['repository'] = null !== $options['translation']
                            ? TranslatableResourceRepository::class
                            : ResourceRepository::class;
                    } elseif (null !== $options['translation']) {
                        if (!is_subclass_of($repository, TranslatableResourceRepositoryInterface::class)) {
                            throw new InvalidOptionsException(sprintf(
                                "Class '%s' must implements '%s'.",
                                $repository,
                                TranslatableResourceRepositoryInterface::class
                            ));
                        }
                    } else {
                        if (!is_subclass_of($repository, ResourceRepositoryInterface::class)) {
                            throw new InvalidOptionsException(sprintf(
                                "Class '%s' must implements '%s'.",
                                $repository,
                                ResourceRepositoryInterface::class
                            ));
                        }
                    }

                    return $classesResolver->resolve($value);
                });


            // Translation option
            $translationResolver = new OptionsResolver();
            $translationResolver
                ->setRequired(['entity', 'fields'])
                ->setDefault('repository', null)
                ->setAllowedTypes('entity', 'string')
                ->setAllowedTypes('fields', 'array')
                ->setAllowedTypes('repository', ['null', 'string'])
                ->setAllowedValues('entity', function ($class) {
                    if (!class_exists($class)) {
                        throw new InvalidOptionsException(sprintf("Class '%s' does not exists.", $class));
                    }
                    if (!is_subclass_of($class, TranslationInterface::class)) {
                        throw new InvalidOptionsException(sprintf("Class '%s' must implements '%s'.", $class, TranslationInterface::class));
                    }

                    return true;
                })
                ->setAllowedValues('fields', function ($fields) {
                    if (empty($fields)) {
                        throw new InvalidOptionsException("Translatable fields cannot be empty.");
                    }

                    return true;
                })
                ->setAllowedValues('repository', function ($class) {
                    if (null !== $class && !class_exists($class)) {
                        throw new InvalidOptionsException(sprintf("Class '%s' does not exists.", $class));
                    }

                    return true;
                });

            /** @noinspection PhpUnusedParameterInspection */
            $resolver->setNormalizer('translation', function (Options $options, $value) use ($translationResolver) {
                if (is_array($value)) {
                    return $translationResolver->resolve($value);
                }

                return $value;
            });


            // Event option
            $eventResolver = new OptionsResolver();
            $eventResolver
                ->setRequired(['class'])
                ->setDefaults([
                    'class'    => $this->defaultEventClass,
                    'priority' => 0,
                ])
                ->setAllowedTypes('class', 'string')
                ->setAllowedTypes('priority', 'int');

            /** @noinspection PhpUnusedParameterInspection */
            $resolver->setNormalizer('event', function (Options $options, $value) use ($eventResolver) {
                if (is_string($value)) {
                    $value = ['class' => $value];
                }

                $value = $eventResolver->resolve((array)$value);

                if (!is_subclass_of($value['class'], ResourceEventInterface::class)) {
                    throw new InvalidOptionsException(sprintf(
                        "Class '%s' must implements '%s'.",
                        $value['class'],
                        ResourceEventInterface::class
                    ));
                }

                return $value;
            });


            // Templates option
            /** @noinspection PhpUnusedParameterInspection */
            $resolver->setNormalizer('templates', function (Options $options, $value) {
                return $this->buildTemplateList($value);
            });


            $this->optionsResolver = $resolver;
        }

        return $this->optionsResolver;
    }
777573
protected function _resolveDefinition(
        DefinitionInterface $definition, array $parameters = [])
    {
        $entryName = $definition->getName();
        $definitionResolver = $this->_getDefinitionResolver($definition);

        try {
            $value = $definitionResolver->resolve($definition, $parameters);
        } catch (\Exception $exception) {
            throw new DependencyException(
                "An error occurred while resolving " .
                "entry '{$entryName}': " . $exception->getMessage(),
                0,
                $exception
            );
        }

        return $value;
    }
1281009
public function getInterfaceBuilder()
    {
        if (!isset($this->interfaceBuilder)) {
            $this->interfaceBuilder = $this->getGeneratorConfig()->getConfiguredBuilder($this->getTable(), 'interface');
        }

        return $this->interfaceBuilder;
    }
845849
public function configureOptions(OptionsResolver $resolver)
    {
        $resolver->setDefaults(
            [
                'widget' => 'single_text',
                'widget_position' => 'right',
                'html5' => false,
                'locale' => $this->locale,
                'format' => null,
                'date_type' => \IntlDateFormatter::SHORT,
                'time_type' => \IntlDateFormatter::SHORT,
            ]
        );
        $resolver->setNormalizer(
            'format',
            function (Options $options, $value) {
                if (null !== $value) {
                    return $value;
                }
                $locale = $options['locale'] ?: 'en';
                $formatter = \IntlDateFormatter::create(
                    $locale,
                    $options['date_type'],
                    $options['time_type']
                );

                return $formatter->getPattern();
            }
        );
    }
707174
private function getResolver(): OptionsResolver
    {
        if (!is_null($this->resolver)) {
            return $this->resolver;
        }

        $this->resolver = $this->buildResolver();

        return $this->resolver;
    }
534262
private function getMapping(TypeInterface $type)
    {
        $type = (string) $type->getType();

        if (!isset($this->mappings[$type])) {
            throw new \InvalidArgumentException(sprintf('The mapping for type "%s" could not be found.', $type));
        }

        return $this->mappings[$type];
    }
325107
private function getClassType($node, TypeInterface $parent): string
    {
        $phpFile = RootRetrieverHelper::getRoot($parent);

        switch (true) {
            case $node instanceof Node\Identifier:
            case $node->isRelative():
            case $node->isUnqualified():
                $name = $this->getUnqualifiedClassType($node, $phpFile);
                break;
            case $node->isFullyQualified():
                $name = $node->toString();
                break;
            case $node->isQualified():
                $name = $this->getQualifiedClassType($node, $phpFile);
                break;
            default:
                return TypeInterface::UNKNOWN_CUSTOM;
        }

        // Get the last name part
        $nameArray = explode('\\', $name);
        $lastPart  = end($nameArray);

        $phpFile->addConcreteUse($name, $lastPart);

        return $lastPart;
    }
668220
public function configureOptions(OptionsResolver $resolver)
    {
        $labelTrueNormalizer = function (Options $options, $value) {
            return !is_null($value) ? (string) $value : $this->humanize($options['value_true']);
        };

        $labelFalseNormalizer = function (Options $options, $value) {
            return !is_null($value) ? (string) $value : $this->humanize($options['value_false']);
        };

        $choicesNormalizer = function (Options $options) {
            return [
                $options['label_true'] => $options['value_true'],
                $options['label_false'] => $options['value_false'],
            ];
        };

        $expandedNormalizer = function (Options $options) {
            return 'choice' !== $options['widget'];
        };

        $multipleNormalizer = function () {
            return false;
        };

        $resolver->setDefaults([
            'label_true' => null,
            'label_false' => null,
            'value_true' => 'yes',
            'value_false' => 'no',
            'widget' => 'choice',
        ]);

        $resolver->setNormalizer('label_true', $labelTrueNormalizer);
        $resolver->setNormalizer('label_false', $labelFalseNormalizer);
        $resolver->setNormalizer('choices', $choicesNormalizer);
        $resolver->setNormalizer('expanded', $expandedNormalizer);
        $resolver->setNormalizer('multiple', $multipleNormalizer);

        $resolver->setAllowedTypes('value_true', ['string', 'integer', 'float']);
        $resolver->setAllowedTypes('value_false', ['string', 'integer', 'float']);
        $resolver->setAllowedTypes('label_true', ['string', 'null']);
        $resolver->setAllowedTypes('label_false', ['string', 'null']);

        $resolver->setAllowedValues('widget', ['choice', 'radio']);
    }
380363
protected function fixDoctrineQueryBuilderNormalizer(OptionsResolver $resolver)
    {
        $queryBuilderNormalizer = function (Options $options, $queryBuilder) {
            if (\is_callable($queryBuilder)) {
                $queryBuilder = $queryBuilder($this->entityManager->getRepository($options['class']), $options);

                if (!$queryBuilder instanceof QueryBuilder) {
                    throw new UnexpectedTypeException($queryBuilder, QueryBuilder::class);
                }
            }

            return $queryBuilder;
        };

        $resolver->setNormalizer('query_builder', $queryBuilderNormalizer);
    }
883511
public function getResolver(){
		if(!isset($this->resolver)){
			$this->resolver = new MultiTypeResolver($this->container, getcwd());
		}
		return $this->resolver;
	}