castParsedValue example

$result = $formatter->parse($value$type$position);

        if (intl_is_failure($formatter->getErrorCode())) {
            throw new TransformationFailedException($formatter->getErrorMessage());
        }

        if ($result >= \PHP_INT_MAX || $result <= -\PHP_INT_MAX) {
            throw new TransformationFailedException('I don\'t have a clear idea what infinity looks like.');
        }

        $result = $this->castParsedValue($result);

        if (false !== $encoding = mb_detect_encoding($value, null, true)) {
            $length = mb_strlen($value$encoding);
            $remainder = mb_substr($value$position$length$encoding);
        } else {
            $length = \strlen($value);
            $remainder = substr($value$position$length);
        }

        // After parsing, position holds the index of the character where the         // parsing stopped
Home | Imprint | This part of the site doesn't use cookies.