@param string $builderName
@param string $builderType
@param array  $builderConfig
@param array  $reservedTypesMap

@return array

@throws InvalidConfigurationException
189097
private static function getFieldBuilderMapping(string $builderName, string $builderType, array $builderConfig, array &$reservedTypesMap)
    {
        $builder = self::getBuilder($builderName, $builderType);
        $mapping = $builder->toMappingDefinition($builderConfig);

        $fieldMappingKey = null;

        if (self::BUILDER_FIELD_TYPE === $builderType) {
            $fieldMappingKey = 'field';
        } elseif (self::BUILDER_FIELDS_TYPE === $builderType) {
            $fieldMappingKey = 'fields';
        }

        $fieldMapping = $mapping[$fieldMappingKey] ?? $mapping;
        $typesMapping = [];

        if (isset($mapping[$fieldMappingKey], $mapping['types'])) {
            $builderClass = \get_class($builder);

            foreach ($mapping['types'] as $typeName => $typeConfig) {
                if (isset($reservedTypesMap[$typeName])) {
                    throw new InvalidConfigurationException(\sprintf(
                        'Type "%s" emitted by builder "%s" already exists. Type was provided by "%s". Builder may only emit new types. Overriding is not allowed.',
                        $typeName,
                        $builderClass,
                        $reservedTypesMap[$typeName]
                    ));
                }

                $reservedTypesMap[$typeName] = $builderClass;
                $typesMapping[$typeName] = $typeConfig;
            }
        }

        return [
            $fieldMappingKey => $fieldMapping,
            'types' => $typesMapping,
        ];
    }
106379
protected function buildClassificationsFromConfiguration($configuredMappedClasses) : array
    {
        $classifications = [];
        foreach ($configuredMappedClasses as $class) {
            if ( (empty($class['patterns']) && empty($class['matchPatterns'])) || empty($class['class'])) {
                throw new \InvalidArgumentException('A class configuration in SOLR_CLASSIFCATION needs to have a pattern and a class configured. Given configuration: ' . serialize($class));
            }

                // @todo deprecate patterns configuration
            $patterns = empty($class['patterns']) ? [] : GeneralUtility::trimExplode(',', $class['patterns']);
            $matchPatterns = empty($class['matchPatterns']) ? [] : GeneralUtility::trimExplode(',', $class['matchPatterns']);
            $matchPatterns = $matchPatterns + $patterns;
            $unMatchPatters = empty($class['unmatchPatterns']) ? [] : GeneralUtility::trimExplode(',', $class['unmatchPatterns']);

            $className = $class['class'];
            $classifications[] = GeneralUtility::makeInstance(
                ClassificationItem::class,
                /** @scrutinizer ignore-type */ $matchPatterns,
                /** @scrutinizer ignore-type */ $unMatchPatters,
                /** @scrutinizer ignore-type */ $className
            );
        }

        return $classifications;
    }
283021
public function preSave(\PHP5ObjectBuilder $builder)
    {
        $const = $builder->getColumnConstant($this->getColumnForParameter('slug_column'));
        $pattern = $this->getParameter('slug_pattern');
        $script = "
if (\$this->isColumnModified($const) && \$this->{$this->getColumnGetter()}()) {
    \$this->{$this->getColumnSetter()}(\$this->makeSlugUnique(\$this->{$this->getColumnGetter()}()));";

        if ($pattern && false === $this->booleanValue($this->getParameter('permanent'))) {
            $script .= "
} elseif (";
            $count = preg_match_all('/{([a-zA-Z]+)}/', $pattern, $matches, PREG_PATTERN_ORDER);

            foreach ($matches[1] as $key => $match) {
                $columnName = $this->underscore(ucfirst($match));
                $column = $this->getTable()->getColumn($columnName);
                if ((null == $column) && $this->getTable()->hasBehavior('symfony_i18n')) {
                    $i18n = $this->getTable()->getBehavior('symfony_i18n');
                    $column = $i18n->getI18nTable()->getColumn($columnName);
                }
                if (null == $column) {
                    throw new \InvalidArgumentException(sprintf('The pattern %s is invalid  the column %s is not found', $pattern, $match));
                }
                $columnConst = $builder->getColumnConstant($column);
                $script .= "\$this->isColumnModified($columnConst)" . ($key < $count - 1 ? " || " : "");
            }

            $script .= ") {
    \$this->{$this->getColumnSetter()}(\$this->createSlug());";
        }

        if (null == $pattern && false === $this->booleanValue($this->getParameter('permanent'))) {
            $script .= "
} else {
    \$this->{$this->getColumnSetter()}(\$this->createSlug());
}";
        } else {
            $script .= "
} elseif (!\$this->{$this->getColumnGetter()}()) {
    \$this->{$this->getColumnSetter()}(\$this->createSlug());
}";
        }

        return $script;
    }
992600
public static function toMigrationMethodName($type, $columnName)
    {
        $typeMap = self::getDoctrineTypeMap();

        if (!in_array($type, $typeMap)) {
            throw new SystemException(sprintf('Unknown column type: %s', $type));
        }

        // Some Doctrine types map to multiple migration types, for example
        // Doctrine boolean could be boolean and tinyInteger in migrations.
        // Some guessing could be required in this method. The method is not
        // 100% reliable.

        if ($type == DoctrineType::DATETIME) {
            // The datetime type maps to datetime and timestamp. Use the name 
            // guessing as the only possible solution.

            if (in_array($columnName, ['created_at', 'updated_at', 'deleted_at', 'published_at', 'deleted_at'])) {
                return self::TYPE_TIMESTAMP;
            }

            return self::TYPE_DATETIME;
        }

        $typeMap = array_flip($typeMap);
        return $typeMap[$type];
    }
1375052
public function getNameValueMapByType( $parentId, $parentType, $type ) {

		$config = [];

		$config[ 'conditions' ][ 'parentId' ]	= $parentId;
		$config[ 'conditions' ][ 'parentType' ] = $parentType;
		$config[ 'conditions' ][ 'type' ]		= $type;

		return $this->getNameValueMap( $config );
	}
1182861
public function process(ContainerBuilder $container)
    {
        $serviceName = $container->getParameter('o_auth2_server.user_provider');

        if ($container->hasAlias($serviceName)) {
            $serviceName = (string) $container->getAlias($serviceName); // to service id
        }

        if (!$container->hasDefinition($serviceName)) {
            throw new InvalidConfigurationException("Service or alias '$serviceName' does not exist.");
        }

        $service = $container->getDefinition($serviceName);

        if (!is_subclass_of($service->getClass(), 'Symfony\\Component\\Security\\Core\\User\\UserProviderInterface')) {
            throw new InvalidConfigurationException(
                "Service '$serviceName' has to implement Symfony\\Component\\Security\\Core\\User\\UserProviderInterface."
            );
        }

        $container->setAlias('o_auth2_server.user_provider', $serviceName);
    }
842026
public static function create($type, ClassMetadataBuilder $builder)
    {
        if (isset(static::$map[$type])) {
            return new static::$map[$type]($builder);
        }

        throw new InvalidArgumentException("Inheritance type [{$type}] does not exist. SINGLE_TABLE and JOINED are support");
    }
16400
public function process(ContainerBuilder $container)
    {
        $tokenClass = $container->getParameter('o_auth2_server.classes.token_type');

        if (!class_exists($tokenClass)) {
            throw new InvalidConfigurationException(
                "Class $tokenClass does not exist."
            );
        }

        if (!is_subclass_of($tokenClass, 'OAuth2\TokenType\ITokenType')) {
            throw new InvalidConfigurationException(
                "Class $tokenClass does not implement OAuth2\\TokenType\\ITokenType."
            );
        }

        $serviceDefinition = new Definition($tokenClass);
        $container->setDefinition('o_auth2_server.token_type', $serviceDefinition);
    }
134654
public function createWidgetRegisterSession(array $allowedTypes = null, $recipient = null, $backupCodeIdentifier = null, $totpIdentifier = null, $issuer = null)
    {
        $widgetRegisterSession = $this->createEmptyWidgetRegisterSession();

        if ($allowedTypes !== null) {
            $widgetRegisterSession->setAllowedTypes($allowedTypes);
        }

        if ($recipient !== null) {
            $widgetRegisterSession->setRecipient($recipient);
        }
        if ($backupCodeIdentifier !== null) {
            $widgetRegisterSession->setBackupCodeIdentifier($backupCodeIdentifier);
        }

        if ($totpIdentifier !== null) {
            $widgetRegisterSession->setTotpIdentifier($totpIdentifier);
        }

        if ($issuer !== null) {
            $widgetRegisterSession->setIssuer($issuer);
        }

        return $widgetRegisterSession;
    }
78517
public function registerExpectedReturnType( $serviceName, $type ) {

		if ( !is_string( $serviceName ) || !is_string( $type ) ) {
			throw new InvalidParameterTypeException( "Expected a string" );
		}

		$this->expectedReturnTypeByHandler[$serviceName] = $type;
	}
564610
final private static function validateClassHasProperty(string $className, string $classProperty, string $builderId)
    {
        $propertyInfo = new PropertyInfoExtractor([new ReflectionExtractor()]);
        $properties = $propertyInfo->getProperties($className);

        if (false === strpos($classProperty, '.')) { // not yet checking associations - Property Accessor can't do this
            if (!in_array($classProperty, $properties)) {
                throw new \InvalidArgumentException(
                    sprintf(
                        'Builder %s Bad Column Declared. Property %s is not accessible in %s.',
                        $builderId,
                        $classProperty,
                        $className
                    )
                );
            }
        }
    }
875702
public function createConnection(array $params, Configuration $config = null, EventManager $eventManager = null, array $mappingTypes = [])
    {
        if (! $this->initialized) {
            $this->initializeTypes();
        }

        $connection = DriverManager::getConnection($params, $config, $eventManager);

        if (! empty($mappingTypes)) {
            $platform = $this->getDatabasePlatform($connection);
            foreach ($mappingTypes as $dbType => $doctrineType) {
                $platform->registerDoctrineTypeMapping($dbType, $doctrineType);
            }
        }

        if (! empty($this->typesConfig)) {
            $this->markTypesCommented($this->getDatabasePlatform($connection));
        }

        return $connection;
    }
1027214
public function getConfigForElement(array $config, $elementName, $beanName, $customKeyName = 'beans')
    {
        if(!isset($config[$elementName])) {
            return false;
        }

        return $config[$elementName];
    }
1178803
public function getTransformer(?array $sourcesTypes, ?array $targetTypes, MapperConfigurationInterface $mapperConfiguration): ?TransformerInterface
    {
        if (null === $sourcesTypes || \count($sourcesTypes) === 0) {
            return null;
        }

        if (\count($sourcesTypes) > 1) {
            $transformer = new MultipleTransformer();

            foreach ($sourcesTypes as $sourceType) {
                $transformer->addTransformer($this->chainTransformerFactory->getTransformer([$sourceType], $targetTypes, $mapperConfiguration), $sourceType);
            }

            return $transformer;
        }

        return null;
    }
378402
@Override
    public synchronized Builder create(String builderConfigId) throws InvalidBuilderException {
        if (builderConfigId == null || builderConfigId.isEmpty()) {
            String err = Tr.formatMessage(tc, "JWT_BUILDER_INVALID", new Object[] { builderConfigId });
            throw new InvalidBuilderException(err);
        }
        if (!active) {
            String err = Tr.formatMessage(tc, "JWT_BUILDER_NOT_ACTIVE", new Object[] { builderConfigId });
            throw new InvalidBuilderException(err);
        }

        // Tr.error(tc, "JWT_BUILDER_NOT_ACTIVE", new Object[] { builderConfigId
        // });
        // return null;
        return new BuilderImpl(builderConfigId);
    }
1081250
public function isSplitSourceAllowedForConfigurationType(string $configurationType): bool
    {
        if (!isset($this->configurationTypes[$configurationType])) {
            throw new Exception\InvalidConfigurationTypeException('Configuration type "' . $configurationType . '" is not registered. You can Register it by calling $configurationManager->registerConfigurationType($configurationType).', 1359998400);
        }

        return $this->configurationTypes[$configurationType]['allowSplitSource'];
    }
1172490
public static function create(ClassMetadataBuilder $builder, NamingStrategy $namingStrategy, $name, callable $callback)
    {
        foreach (self::getFactories() as $buildable => $check) {
            if ($check($builder->getClassMetadata(), $name)) {
                return new $buildable($builder, $namingStrategy, $name, $callback);
            }
        }

        throw new InvalidArgumentException('No attribute or association could be found for '.$name);
    }