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;
    }
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;
    }
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 ; }
Resolve ISO_8601 duration format

@param  \DateInterval $interval
@return string | null
Resolve ISO_8601 duration format