Templating/Helper/Format/FormatHelper.php
protected function guessFormat($value)
    {
        $format = null;
        $type = \gettype($value);

        switch ($type) {
            case 'boolean':
                $format = 'boolean';
                break;
            case 'integer':
            case 'double':
                $format = 'number';
                break;
            case 'string':
            case 'NULL':
            case 'resource':
                $format = 'text';
                break;
            case 'object':
                if ($value instanceof \DateTime) {
                    $format = 'datetime';
                } else {
                    $format = 'text';
                }
                break;
        }

        if (null === $format) {
            throw new \RuntimeException(\sprintf(
                'Could not guess format for a value of type "%s". Please provide a format.',
                $type
            ));
        }

        return $format;
    }
protected function guessFormat($value)
    {
        $format = null;
        $type = \gettype($value);

        switch ($type) {
            case 'boolean':
                $format = 'boolean';
                break;
            case 'integer':
            case 'double':
                $format = 'number';
                break;
            case 'string':
            case 'NULL':
            case 'resource':
                $format = 'text';
                break;
            case 'object':
                if ($value instanceof \DateTime) {
                    $format = 'datetime';
                } else {
                    $format = 'text';
                }
                break;
        }

        if (null === $format) {
            throw new \RuntimeException(\sprintf(
                'Could not guess format for a value of type "%s". Please provide a format.',
                $type
            ));
        }

        return $format;
    }
@param mixed $value

@throws \RuntimeException if the format could not be determined

@return string