It converts and normalizes nested sets to pg.

@param \Phn\Mapping\Normalizer\NormalizerInterface $normalizer
@param \Phn\Mapping\Converter\ConverterInterface   $converter
506637
function it_converts_and_normalizes_nested_sets_to_pg($normalizer, $converter)
    {
        $this->setType('decimal', $converter, $normalizer);

        $this
            ->toPg(
                [
                    [
                        (object) [
                            'value' => 3.14159265359
                        ]
                    ],
                    [
                        (object) [
                            'value' => 1.66180339887
                        ]
                    ]
                ],
                'decimal[][]'
            )
            ->shouldBeLike(new Set(
                [
                    new Set(
                        [
                            new Value('3.14159265359', new Type('decimal'))
                        ],
                        new ArrayType(new Type('decimal'))
                    ),
                    new Set(
                        [
                            new Value('1.66180339887', new Type('decimal'))
                        ],
                        new ArrayType(new Type('decimal'))
                    )
                ],
                new ArrayType(new ArrayType(new Type('decimal')))
            ))
        ;
    }
26904
protected function convertFunctionariesFilter($mappingConfiguration, string $filter = null)
    {
        $this->updateMappingConfigurationForAllowedPoperties($mappingConfiguration, $this->settings['filterFunctionaries']['allowedProperty']);

        return $this->objectManager->get(PropertyMapper::class)->convert($this->filtertextToArray($filter), FunctionariesFilter::class, $mappingConfiguration);
    }
117571
public function normalizeField(
        string $path,
        $object,
        NormalizerContextInterface $context,
        NormalizerInterface $normalizer = null
    ) {
        if (null === $normalizer) {
            throw SerializerLogicException::createMissingNormalizer($path);
        }

        if (null === $relatedObject = $this->accessor->getValue($object)) {
            return null;
        }

        return $normalizer->normalize($relatedObject, $context, $path);
    }
1078600
function it_converts_nested_sets_to_pg($converter)
    {
        $this->setType('decimal', $converter);

        $this->toPg([[3.14159265359], [1.66180339887]], 'decimal[][]')->shouldBeLike(new Set(
            [
                new Set(
                    [
                        new Value('3.14159265359', new Type('decimal'))
                    ],
                    new ArrayType(new Type('decimal'))
                ),
                new Set(
                    [
                        new Value('1.66180339887', new Type('decimal'))
                    ],
                    new ArrayType(new Type('decimal'))
                )
            ],
            new ArrayType(new ArrayType(new Type('decimal')))
        ));
    }
1062074
public function normalize($normalizer)
    {
        if (is_string($normalizer) && isset($this->normalizers[$normalizer])) {

            $this->normalizer = $this->normalizers[$normalizer];

        } else if ($normalizer instanceof NormalizerInterface) {

            $this->normalizer = $normalizer;

        }

        return $this;
    }
1206959
public function normalizeField(
        string $path,
        $object,
        NormalizerContextInterface $context,
        NormalizerInterface $normalizer = null
    ) {
        if (null === $normalizer) {
            throw SerializerLogicException::createMissingNormalizer($path);
        }

        if (null === $relatedObjects = $this->accessor->getValue($object)) {
            return null;
        }

        $values = [];
        foreach ($relatedObjects as $i => $relatedObject) {
            $subPath = $path.'['.$i.']';
            $values[$i] = $normalizer->normalize($relatedObject, $context, $subPath);
        }

        return $values;
    }
240683
public static function defaultConverter(FileInterface $_file, $_convertTo)
    {
        $subtitleClass = __NAMESPACE__.'\\Format\\'.ucfirst($_convertTo).'File';

        if (!class_exists($subtitleClass)) {
            throw new \InvalidArgumentException(sprintf('Unable to convert to "%s", this format does not exists.', $_convertTo));
        }

        $newSub        = new $subtitleClass();
        $cueClass      = File::getExpectedCueClass($newSub);

        foreach ($_file->getCues() as $cue) {
            $newSub->addCue($cue->getText(), $cueClass::ms2tc($cue->getStartMS()), $cueClass::ms2tc($cue->getStopMS()));
        }

        return $newSub;
    }
131624
public function normalize($object, $format = null, array $context = [])
    {
        foreach ($this->normalizers as $normalizer) {
            // Return the result from the first denormalizer that can
            // denormalize this.
            if ($normalizer->supportsNormalization($object, $format)) {
                return $normalizer->normalize($object, $format, $context);
            }
        }
    }
1337818
public function set(TypeConverterInterface $converter)
    {
        $this->converters[$converter->getTypeNamespace() . ':'
            . $converter->getTypeName()] = $converter;

        return $this;
    }
1129948
public function setConvertors(array $convertors)
	{
		$this->callbacks  = [];
		$this->matchGroup = [];
		$this->groups     = [];
		$this->regexps    = [];
		foreach ($convertors as $convertor)
		{
			$this->addConvertor($convertor);
		}

		// Sort regexps by length to keep their order consistent
		$this->sortRegexps();

		// Add regexp groups
		foreach ($this->groups as $group => $captures)
		{
			sort($captures);
			$this->regexps[$group] = '(?<' . $group . '>' . implode('|', $captures) . ')';
		}

		$this->regexp = '(^(?:' . implode('|', $this->regexps) . ')$)';
	}
278015
protected function prepareTypeConverterMap()
    {
        $typeConverterMap = [];
        $typeConverterClassNames = static::getTypeConverterImplementationClassNames($this->objectManager);
        foreach ($typeConverterClassNames as $typeConverterClassName) {
            /** @var TypeConverterInterface $typeConverter */
            $typeConverter = $this->objectManager->get($typeConverterClassName);
            foreach ($typeConverter->getSupportedSourceTypes() as $supportedSourceType) {
                $normalizedSourceType = TypeHandling::normalizeType($supportedSourceType);
                $normalizedTargetType = TypeHandling::normalizeType($typeConverter->getSupportedTargetType());
                if (isset($typeConverterMap[$normalizedSourceType][$normalizedTargetType][$typeConverter->getPriority()])) {
                    throw new Exception\DuplicateTypeConverterException('There exist at least two converters which handle the conversion from "' . $supportedSourceType . '" to "' . $normalizedTargetType . '" with priority "' . $typeConverter->getPriority() . '": ' . $typeConverterMap[$supportedSourceType][$normalizedTargetType][$typeConverter->getPriority()] . ' and ' . get_class($typeConverter), 1297951378);
                }
                $typeConverterMap[$normalizedSourceType][$normalizedTargetType][$typeConverter->getPriority()] = $typeConverterClassName;
            }
        }

        return $typeConverterMap;
    }
470999
public function denormalize($data, $type, $format = null, array $context = [])
    {
        if (!$this->normalizers) {
            throw new LogicException('You must register at least one normalizer to be able to denormalize objects.');
        }

        if ($normalizer = $this->getDenormalizer($data, $type, $format, $context)) {
            return $normalizer->denormalize($data, $type, $format, $context);
        }

        throw new NotNormalizableValueException(sprintf('Could not denormalize object of type %s, no supporting normalizer found.', $type));
    }
1028300
protected function transform($instance, string $transformer, ?string $serializer = null, array $options = [])
    {
        if (\is_null($serializer)) {
            $serializer = $transformer;
        }

        return $this->serializeWith(
            $this->transformWith($instance, $transformer, $options),
            $serializer,
            $options
        );
    }
544200
public static function create(
        string $name,
        LinkNormalizerInterface $linkNormalizer
    ): NormalizationLinkMappingBuilderInterface {
        $self = new self();
        $self->name = $name;
        $self->groups = [];
        $self->linkNormalizer = $linkNormalizer;

        return $self;
    }
1670
protected static function prepareSerializer(SerializerInterface $serializer = null)
    {
        if (null === $serializer) {
            $serializer = SerializerFactory::create();
        }

        return $serializer;
    }
469648
public <FT> CsvProcessor<T> withConverter(Class<FT> clazz, Converter<FT, ?> converter) {
		converterMap.put(clazz, converter);
		return this;
	}
903105
public function add(string $type, RowFieldNormalizerInterface $normalizer)
    {
        $this->normalizers[$type] = $normalizer;
        return $this;
    }