src/Common/TimeExpression.php
protected function integerToString($time): string
    {
        $tokens = array_reverse($this->tokensValues, true);
        $expression = [];

        foreach ($tokens as $token => $value) {
            if ($time <= 0) {
                break;
            }
            if ($time < $value || !in_array($token, array_keys($this->tokensValues))) {
                continue;
            }
            $mod = 0;
            if ($time & $value) {
                $mod = fmod($time, $value);
                $time -= $mod;
            }
            $div = round($time / $value);

            $expression[] = sprintf(
                '%d %s',
                $div,
                ($token.(($div > 1 && substr($token, -1, 1) !== 's') ? 's' : ''))
            );
            $time = $mod;
        }

        $return = implode(' ', $expression);
        if (empty($return)) {
            $return = sprintf('%d %s', 0, 'ms');
        }

        return $return;
    }
protected function integerToString($time): string
    {
        $tokens = array_reverse($this->tokensValues, true);
        $expression = [];

        foreach ($tokens as $token => $value) {
            if ($time <= 0) {
                break;
            }
            if ($time < $value || !in_array($token, array_keys($this->tokensValues))) {
                continue;
            }
            $mod = 0;
            if ($time & $value) {
                $mod = fmod($time, $value);
                $time -= $mod;
            }
            $div = round($time / $value);

            $expression[] = sprintf(
                '%d %s',
                $div,
                ($token.(($div > 1 && substr($token, -1, 1) !== 's') ? 's' : ''))
            );
            $time = $mod;
        }

        $return = implode(' ', $expression);
        if (empty($return)) {
            $return = sprintf('%d %s', 0, 'ms');
        }

        return $return;
    }
protected function integerToString ( $ time ) : string { $ tokens = array_reverse ( $ this -> tokensValues , true ) ; $ expression = [ ] ; foreach ( $ tokens as $ token => $ value ) { if ( $ time <= 0 ) { break ; } if ( $ time < $ value || ! in_array ( $ token , array_keys ( $ this -> tokensValues ) ) ) { continue ; } $ mod = 0 ; if ( $ time & $ value ) { $ mod = fmod ( $ time , $ value ) ; $ time -= $ mod ; } $ div = round ( $ time / $ value ) ; $ expression [ ] = sprintf ( '%d %s' , $ div , ( $ token . ( ( $ div > 1 && substr ( $ token , - 1 , 1 ) !== 's' ) ? 's' : '' ) ) ) ; $ time = $ mod ; } $ return = implode ( ' ' , $ expression ) ; if ( empty ( $ return ) ) { $ return = sprintf ( '%d %s' , 0 , 'ms' ) ; } return $ return ; }
Transform an integer to a non ISO8601 interval string

@param integer $time
@return string
Transform an integer to a non ISO8601 interval string