src/Captioning/File.php
public function shift($_time, $_startIndex = null, $_endIndex = null)
    {
        if (!is_int($_time)) {
            return false;
        }
        if ($_time == 0) {
            return true;
        }

        if (null === $_startIndex) {
            $_startIndex = 0;
        }
        if (null === $_endIndex) {
            $_endIndex = $this->getCuesCount() - 1;
        }

        $startCue = $this->getCue($_startIndex);
        $endCue   = $this->getCue($_endIndex);

        //check subtitles do exist
        if (!$startCue || !$endCue) {
            return false;
        }

        for ($i = $_startIndex; $i <= $_endIndex; $i++) {
                $cue = $this->getCue($i);
                $cue->shift($_time);
        }

        return true;
    }
public function shift($_time, $_startIndex = null, $_endIndex = null)
    {
        if (!is_int($_time)) {
            return false;
        }
        if ($_time == 0) {
            return true;
        }

        if (null === $_startIndex) {
            $_startIndex = 0;
        }
        if (null === $_endIndex) {
            $_endIndex = $this->getCuesCount() - 1;
        }

        $startCue = $this->getCue($_startIndex);
        $endCue   = $this->getCue($_endIndex);

        //check subtitles do exist
        if (!$startCue || !$endCue) {
            return false;
        }

        for ($i = $_startIndex; $i <= $_endIndex; $i++) {
                $cue = $this->getCue($i);
                $cue->shift($_time);
        }

        return true;
    }
public function shift ( $ _time , $ _startIndex = null , $ _endIndex = null ) { if ( ! is_int ( $ _time ) ) { return false ; } if ( $ _time == 0 ) { return true ; } if ( null === $ _startIndex ) { $ _startIndex = 0 ; } if ( null === $ _endIndex ) { $ _endIndex = $ this -> getCuesCount ( ) - 1 ; } $ startCue = $ this -> getCue ( $ _startIndex ) ; $ endCue = $ this -> getCue ( $ _endIndex ) ; //check subtitles do exist if ( ! $ startCue || ! $ endCue ) { return false ; } for ( $ i = $ _startIndex ; $ i <= $ _endIndex ; $ i ++ ) { $ cue = $ this -> getCue ( $ i ) ; $ cue -> shift ( $ _time ) ; } return true ; }
Shifts a range of subtitles a specified amount of time.

@param int $_time The time to use (ms), which can be positive or negative.
@param int $_startIndex The subtitle index the range begins with.
@param int $_endIndex The subtitle index the range ends with.
Shifts a range of subtitles a specified amount of time .