It converts values to pg

@param \Phn\Mapping\Converter\ConverterInterface $converter
506581
function it_converts_values_to_pg($converter)
    {
        $this->setType('decimal', $converter);

        $this->toPg(1.66180339887, 'decimal')->shouldBeLike(new Value('1.66180339887', new Type('decimal')));
    }
209648
public function mapKeyValue(callable $converter)
    {
        return new Enumerator(
            function () use($converter) {
                foreach ($this->each() as $k => $v) {
                    $r = call_user_func($converter, $k, $v);
                    yield key($r) => current($r);
                }
            }
        );
    }
1101272
public function convertToPHPValue($value, AbstractPlatform $platform) : ?DateTime
    {
        if ($value === null || $value instanceof DateTime) {

            return $value;
        }

        if ( ! $this->getUtc() instanceof DateTimeZone) {

            $this->setUtc(new DateTimeZone('UTC'));
        }

        /** @var DateTime $converted */
        $converted = DateTime::createFromFormat(
            $platform->getDateTimeFormatString(),
            $value,
            $this->getUtc()
        );

        if ( ! $converted) {
            throw ConversionException::conversionFailedFormat(
                $value,
                $this->getName(),
                $platform->getDateTimeFormatString()
            );
        }

        return $converted;
    }
602068
public function convertToPHPValue($value, PlatformInterface $platform)
    {
        if ($value === null) {
            return;
        }

        if (is_string($value)) {
            $value = fopen('data://text/plain;base64,'.base64_encode($value), 'r');
        }

        if (!is_resource($value)) {
            throw TypeException::conversionToPHPFailed($value, $this->getName());
        }

        return $value;
    }
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')))
            ))
        ;
    }
614381
public function mappedVia(callable $phpToDbConverter, callable $dbToPhpConverter)
    {
        $this->phpToDbConverter = $phpToDbConverter;
        $this->dbToPhpConverter = $dbToPhpConverter;

        return $this;
    }
1287130
public function convertToDatabaseValue($value, AbstractPlatform $platform)
    {
        if (empty($value)) {
            return null;
        }

        if ($value instanceof Money) {
            return (string) $value->getCurrency().' '.$value->getAmount();
        }

        throw ConversionException::conversionFailed($value, self::NAME);
    }
999848
public function convertToPHPValue($value, AbstractPlatform $platform)
    {
        if (!$value || !is_string($value)) {
            return null;
        }

        $timepoint = self::getParsingClock()->fromString($value, 'Y-m-d H:i:s');

        if (!$timepoint) {
            throw ConversionException::conversionFailedFormat($value, $this->getName(), $platform->getDateTimeFormatString());
        }

        return $timepoint;
    }
261340
protected function prepareConverters($sql)
    {
        foreach ($this->getParametersType($sql) as $index => $type) {
            if ($type === '') {
                $this->converters[$index] = null;
            } else {
                $converter = $this
                    ->getSession()
                    ->getClientUsingPooler('converter', $type)
                    ->getConverter()
                    ;

                $this->converters[$index] = function ($value) use ($converter, $type) {
                    return $converter->toPgStandardFormat($value, $type, $this->getSession());
                };
            }
        }

        return $this;
    }
787039
public function convertToPHPValue($value, AbstractPlatform $platform)
    {
        if ($value === null) {
            return;
        }

        $val = \DateTime::createFromFormat(
            $platform->getDateTimeFormatString(),
            $value,
            new \DateTimeZone('UTC')
        );
        if (!$val) {
            throw ConversionException::conversionFailed($value, $this->getName());
        }

        return $val;
    }
550350
public function beforeConvert(ConvertEvent $convertEvent): void
    {
        if ($convertEvent->isHandledBy(SculpinMarkdownBundle::CONVERTER_NAME, SculpinTwigBundle::FORMATTER_NAME)) {
            $content = $convertEvent->source()->content();
            foreach (self::$addPlaceholderRe as $re) {
                $content = preg_replace($re, self::$placeholder, $content);
            }
            $content = preg_replace(
                '/{%\s+(\w+)\s+(\w+\++\w+)\s+%}(.*){%\s+end\1\s+%}/Us',
                '<div data-$1="$2">$3</div>',
                $content
            );
            $convertEvent->source()->setContent($content);
        }
    }
1040649
public function convertToPHPValue($value, AbstractPlatform $platform)
    {
        $result = null;

        if ($value !== null && ($dateOrNull = parent::convertToPHPValue($value, $platform)) !== null) {
            // despite the name it's not null already
            $result = DateTime::createFromDateTime($dateOrNull);
        }

        return $result;
    }
143494
public function convertToDatabaseValue($value, AbstractPlatform $platform)
    {
        if (null === $value || '' === $value) {
            return $value;
        }

        if ( ! $value instanceof Money) {
            $type = is_object($value) ? get_class($value) : gettype($value);
            throw new \InvalidArgumentException(sprintf('You have to pass an object of kind \SerendipityHQ\Component\ValueObjects\Money\Money to use the Doctrine type MoneyType. "%s" passed instead.', $type));
        }

        return $value->getBaseAmount() . '-' . $value->getCurrency()->getCode();
    }
940391
public function convertToPHPValue($value, AbstractPlatform $platform)
    {
        if (is_string($value)) {
            return parent::convertToPHPValue($value, $platform);
        }

        return $value;
    }
862869
public function runAllConversions($value)
    {
        $misc = new \Expose\Converter\ConvertMisc;
        $value = $misc->convertFromUrlEncode($value);
        $value = $misc->convertFromCommented($value);
        $value = $misc->convertFromWhiteSpace($value);
        $value = $misc->convertEntities($value);
        $value = $misc->convertQuotes($value);
        $value = $misc->convertFromControlChars($value);
        $value = $misc->convertFromNestedBase64($value);
        $value = $misc->convertFromOutOfRangeChars($value);
        $value = $misc->convertFromXML($value);
        $value = $misc->convertFromUTF7($value);
        $value = $misc->convertFromConcatenated($value);
        $value = $misc->convertFromProprietaryEncodings($value);
        
        $js = new \Expose\Converter\ConvertJS;
        $value = $js->convertFromJSCharcode($value);
        $value = $js->convertJSRegexModifiers($value);
        $value = $js->convertFromJSUnicode($value);

        $sql = new \Expose\Converter\ConvertSQL;
        $value = $sql->convertFromSQLHex($value);
        $value = $sql->convertFromSQLKeywords($value);
        $value = $sql->convertFromUrlencodeSqlComment($value);

        return $value;
    }
1264672
public static function ChangeType( $value, $conversionType, $provider = null )
	{
		return Convert::ToType( $value, $conversionType, $provider );
	}
823151
public function phpSerialize($value, $igBinary = true)
    {
        if ($igBinary && function_exists('igbinary_serialize')) {
            return igbinary_serialize($value);
        }

        return serialize($value);
    }