protected function resolveFormat(\DateInterval $interval): string
    {
        $baseFormat = $this->resolveBaseFormat($interval);
        $timeFormat = $this->resolveTimeFormat($interval);

        if ($baseFormat === '') {
            if ($timeFormat === '') {
                return '';
            }

            return 'PT' . $timeFormat;
        }

        if ($timeFormat === '') {
            return 'P' . $baseFormat;
        }

        return 'P' . $baseFormat . 'T' . $timeFormat;
    }