@param string                  $name
@param LinkNormalizerInterface $linkNormalizer

@return NormalizationLinkMappingBuilderInterface
544200
public static function create(
        string $name,
        LinkNormalizerInterface $linkNormalizer
    ): NormalizationLinkMappingBuilderInterface {
        $self = new self();
        $self->name = $name;
        $self->groups = [];
        $self->linkNormalizer = $linkNormalizer;

        return $self;
    }
1134311
public static function createGenericNormalizers()
    {
        return new UserAgentNormalizer(
            array(
                new UCWEB(),
                new UPLink(),
                new SerialNumbers(),
                new LocaleRemover(),
                new CFNetwork(),
                new BlackBerry(),
                new GenericAndroid(),
                new TransferEncoding(),
            )
        );
    }
1002082
public function normalizeDefinitionName(string $name): string
    {
        $elements = explode('/', $name);

        return $elements[count($elements) - 1];
    }
179217
public function GetNamedLink($name, $link, $target = null)
    {
        $result = '';
        if (strlen($name) != 0) {
            $result = $name;
            if (strlen($link) != 0) {
                $result = "<a href=\"".$link."\"".(is_null($target) ? "" : " target=\"".$target."\"").">".$result."</a>";
            }
        }
        return $result;
    }
857329
private static function normalizeHeaderName(string $name) : string
  {
    if (0 === preg_match('/^[^\x00-\x1F :]+$/', $name)) {
      throw new InvalidArgumentException(sprintf(
        '%s is not a valid header name.', 
        $name
      ));
    }

    return strtolower($name);
  }
831937
public function getRequestEscapedParameter($name, $defaultValue = null)
    {
        $value = $this->getRequestParameter($name, $defaultValue);

        // TODO: remove this after special chars concept implementation
        $isAdmin = Registry::getConfig()->isAdmin() && Registry::getSession()->getVariable("blIsAdmin");
        if ($value !== null && !$isAdmin) {
            $this->checkParamSpecialChars($value);
        }

        return $value;
    }
461862
public static function createEmbedOne(string $name, string $class): DenormalizationFieldMappingBuilderInterface
    {
        $self = new self($name);
        $self->fieldDenormalizer = new EmbedOneFieldDenormalizer($class, new PropertyAccessor($name));

        return $self;
    }
768126
protected function updateNormalizers(Index $index, string $name)
    {
        $settings = $index->getSettings();
        $customNormalizers = $this->getCustomNormalizers();
        $missingNormalizers = [];

        try {
            foreach ($customNormalizers as $id => $normalizer) {
                if (!$settings->get("analysis.normalizer.{$id}")) {
                    $missingNormalizers[$id] = $normalizer;
                }
            }
        } catch (\Throwable $e) {
            $this->logger->error(
                sprintf('Unable to read index [%s] and get normalizer settings.', $name),
                ['exception' => $e, 'index_name' => $name]
            );

            return;
        }

        if (empty($missingNormalizers)) {
            $this->logger->info(
                sprintf(
                    'Index [%s] has all custom normalizers [%s].',
                    $name,
                    implode(',', array_keys($customNormalizers))
                )
            );

            return;
        }

        $this->logger->warning(
            sprintf(
                'Closing index [%s] to add custom normalizers [%s].',
                $name,
                implode(',', array_keys($missingNormalizers))
            )
        );

        try {
            $index->close();
            $index->setSettings(['analysis' => ['normalizer' => $missingNormalizers]]);
            $index->open();
        } catch (\Throwable $e) {
            $this->logger->error(
                sprintf('Unable to close index [%s] and update normalizer settings.', $name),
                ['exception' => $e, 'index_name' => $name]
            );

            return;
        }

        $this->logger->info(sprintf('Successfully added missing normalizers to index [%s]', $name));
    }
117314
function linkedPhp()
    {
        $matches = $this->getParsedLinkedPhp();
        $resolvedPhpVersion = $matches[3] ?: $matches[2];

        return $this->supportedPhpVersions()->first(   
            function ($version) use ($resolvedPhpVersion) {
                $resolvedVersionNormalized = preg_replace('/[^\d]/', '', $resolvedPhpVersion);
                $versionNormalized = preg_replace('/[^\d]/', '', $version);
                return $resolvedVersionNormalized === $versionNormalized;
        }, function () use ($resolvedPhpVersion) {
            throw new DomainException("Unable to determine linked PHP when parsing '$resolvedPhpVersion'");
        });
    }
664061
protected function denormalizeRelation(string $attributeName, PropertyMetadata $propertyMetadata, string $className, $value, ?string $format, array $context)
    {
        // Give a chance to other normalizers (e.g.: DateTimeNormalizer)
        if (!$this->resourceClassResolver->isResourceClass($className)) {
            $context['resource_class'] = $className;

            if ($this->serializer instanceof DenormalizerInterface) {
                return $this->serializer->denormalize($value, $className, $format, $context);
            }
            throw new LogicException(sprintf('The injected serializer must be an instance of "%s".', DenormalizerInterface::class));
        }

        if (!\is_array($value) || !isset($value['id'], $value['type'])) {
            throw new NotNormalizableValueException('Only resource linkage supported currently, see: http://jsonapi.org/format/#document-resource-object-linkage.');
        }

        try {
            return $this->iriConverter->getItemFromIri($value['id'], $context + ['fetch_data' => true]);
        } catch (ItemNotFoundException $e) {
            throw new RuntimeException($e->getMessage(), $e->getCode(), $e);
        }
    }
65270
protected function _getNormalizeHostTarget() {
        $configHost = trim(Mage::getStoreConfig(
            'turpentine_vcl/normalization/host_target' ));
        if ($configHost) {
            return $configHost;
        } else {
            $baseUrl = parse_url(Mage::getBaseUrl());
            if (isset($baseUrl['port'])) {
                return sprintf('%s:%d', $baseUrl['host'], $baseUrl['port']);
            } else {
                return $baseUrl['host'];
            }
        }
    }
839309
public function setLinkLevel($linkLevel)
    {

        if (($linkLevel > 10)) {
            throw new \InvalidArgumentException('invalid value for $linkLevel when calling GetCharactersCharacterIdPlanetsPlanetIdLink., must be smaller than or equal to 10.');
        }
        if (($linkLevel < 0)) {
            throw new \InvalidArgumentException('invalid value for $linkLevel when calling GetCharactersCharacterIdPlanetsPlanetIdLink., must be bigger than or equal to 0.');
        }

        $this->container['linkLevel'] = $linkLevel;

        return $this;
    }
811303
protected function satisfyVersion(Link $require, $normalizedVersion)
    {
        $constraintSame = $this->versionParser->parseConstraints($normalizedVersion);
        $sameVersion = (bool) $require->getConstraint()->matches($constraintSame);

        $consNormalizedVersion = FilterUtil::getVersionConstraint($normalizedVersion, $this->versionParser);
        $constraint = FilterUtil::getVersionConstraint($consNormalizedVersion->getPrettyString(), $this->versionParser);

        return (bool) $require->getConstraint()->matches($constraint) || $sameVersion;
    }
67656
public static function createReferenceMany(
        string $name,
        callable $repository
    ): DenormalizationFieldMappingBuilderInterface {
        $self = new self($name);
        $self->fieldDenormalizer = new ReferenceManyFieldDenormalizer($repository, new PropertyAccessor($name));

        return $self;
    }
1047167
public static function linkRoute($name, $params = array(), $url = null)
    {
        //starting defining url and qs
        $url = ($url != '') ? $url : $_SERVER["REQUEST_URI"];
        $url_arr = explode('?', $url);
        $url = $url_arr[0];
        $qs = (isset($url_arr[1])) ? $url_arr[1] : '';
        if (!is_array($params)) $params = (array) $params;
        
        //is a stric-uri?
        if (isset(self::$routes[$name][0]) and self::$routes[$name][0]=== '^') {
            $is_strict = true;
            $route = self::$routes[$name];
            //in this case remove conditional patterns
            $url = self::parsePattern($route, true);

            //we remove also conditional atoms
            $url = preg_replace('#\(.*\)\?#', '', $route);

            $url = ltrim($url, '^');
            $url = rtrim($url, '$');
            if (preg_match_all('#\(.*\)#U',$url, $matches)) {
                foreach ($params as $key=>$param) {
                    $url = str_replace($matches[0][$key],$param, $url);
                }
            }
            
            if (self::$qs[$name]) {
                $qs = preg_replace('#(&?)'.self::$qs[$name].'#', '', $qs);
            }
            
        //non strict route
        } else {
            $is_strict = false;
            
            //If required we remove other routes (from segments and qs)
            if (count(self::$remove[$name])) {

                foreach (self::$remove[$name] as $route) {

                    if (self::$routes[$route]) {
                        $url = preg_replace('#(\/?)'.self::$routes[$route].'#', '', $url);
                    }
                    if (self::$qs[$route]) {
                        $qs = preg_replace('#(&?)'.self::$qs[$route].'#', '', $qs);
                    }

                }
            }

            //if this route works with uri
            //I check for all params to build the append segment with given params,
            //then I strip current rule and append new one.
            if (self::$routes[$name]) {
                $append =  self::$routes[$name];
                if (preg_match_all('#\(.*\)#U',$append, $matches)) {
                    foreach ($params as $key=>$param) {
                        $append = str_replace($matches[0][$key],$param, $append);
                    }
                }
                $url = preg_replace('#(\/?)'.self::$routes[$name].'#', '', $url);
                $url = $url."/".$append;
                $url = str_replace('//','/',$url);

            }
            
        }

        
        //if this route works on query string
        //I check for all params to buid and "append" or "replace" query string with given params.
        $append = '';
        if (self::$qs[$name]) {
            $append =  self::$qs[$name];
            if (preg_match_all('#\(.*\)#U',$append, $matches)) {
                foreach ($params as $key=>$param) {
                    $append = str_replace($matches[0][$key],$param, $append);
                }
            }
            $qs = preg_replace('#(&?)'.self::$qs[$name].'#', '', $qs);
            $qs = str_replace('&&','&',$qs);
            $qs = rtrim($qs, '&');
            $qs =  $qs .'&'.$append;
            $qs = ltrim($qs, '&');

        }
        if ($is_strict == true) $qs = $append;
        if ($qs != '') $qs = '?'.$qs;
        if ($url == '') $url = '/';
        return $url.$qs;
    }
95169
protected static function _normalizeName($name)
    {
        $name = ucfirst(strtolower($name));
        $name = str_replace(array('-', '_', '.'), ' ', $name);
        $name = ucwords($name);
        $name = str_replace(' ', '', $name);
        if (stripos($name, 'ZendServer') === 0) {
            $name = 'ZendServer_' . substr($name, strlen('ZendServer'));
        }

        return $name;
    }
455054
public static function createDateTime(string $name, string $format = 'c'): NormalizationFieldMappingBuilderInterface
    {
        $self = new self($name);
        $self->fieldNormalizer = new DateTimeFieldNormalizer(new PropertyAccessor($name), $format);

        return $self;
    }