src/Serializer/JsonDeserializer.php
private function convertValueAccordingToType(string $type, $value)
    {
        if (is_null($value) || 'null' === $value || 'NULL' === $value) {
            return; // nulls shouldn't be converted
        }

        switch ($type) { /* @see Rule::$type */
            default:
                throw new JsonDeserializerUnexpectedTypeException(sprintf('Unexpected type %s', $type));
            case 'string':
                return strval($value);
            case 'integer':
                return intval($value);
            case 'double':
                return floatval($value);
            case 'date':
            case 'time':
            case 'datetime':
                return new \DateTimeImmutable($value);
            case 'boolean':
                return boolval($value);
        }
    }
private function convertValueAccordingToType(string $type, $value)
    {
        if (is_null($value) || 'null' === $value || 'NULL' === $value) {
            return; // nulls shouldn't be converted
        }

        switch ($type) { /* @see Rule::$type */
            default:
                throw new JsonDeserializerUnexpectedTypeException(sprintf('Unexpected type %s', $type));
            case 'string':
                return strval($value);
            case 'integer':
                return intval($value);
            case 'double':
                return floatval($value);
            case 'date':
            case 'time':
            case 'datetime':
                return new \DateTimeImmutable($value);
            case 'boolean':
                return boolval($value);
        }
    }
@param string $type
@param mixed  $value

@return mixed