src/Captioning/File.php
public function addCue($_mixed, $_start = null, $_stop = null)
    {
        $fileFormat = self::getFormat($this);

        // if $_mixed is a Cue
        if (is_object($_mixed) && class_exists(get_class($_mixed)) && class_exists(__NAMESPACE__.'\Cue') && is_subclass_of($_mixed, __NAMESPACE__.'\Cue')) {
            $cueFormat = Cue::getFormat($_mixed);
            if ($cueFormat !== $fileFormat) {
                throw new \Exception("Can't add a $cueFormat cue in a $fileFormat file.");
            }
            $_mixed->setLineEnding($this->lineEnding);
            $this->cues[] = $_mixed;
        } else {
            $cueClass = self::getExpectedCueClass($this);
            $cue = new $cueClass($_start, $_stop, $_mixed);
            $cue->setLineEnding($this->lineEnding);
            $this->cues[] = $cue;
        }

        return $this;
    }
public function addCue($_mixed, $_start = null, $_stop = null)
    {
        $fileFormat = self::getFormat($this);

        // if $_mixed is a Cue
        if (is_object($_mixed) && class_exists(get_class($_mixed)) && class_exists(__NAMESPACE__.'\Cue') && is_subclass_of($_mixed, __NAMESPACE__.'\Cue')) {
            $cueFormat = Cue::getFormat($_mixed);
            if ($cueFormat !== $fileFormat) {
                throw new \Exception("Can't add a $cueFormat cue in a $fileFormat file.");
            }
            $_mixed->setLineEnding($this->lineEnding);
            $this->cues[] = $_mixed;
        } else {
            $cueClass = self::getExpectedCueClass($this);
            $cue = new $cueClass($_start, $_stop, $_mixed);
            $cue->setLineEnding($this->lineEnding);
            $this->cues[] = $cue;
        }

        return $this;
    }
public function addCue ( $ _mixed , $ _start = null , $ _stop = null ) { $ fileFormat = self :: getFormat ( $ this ) ; // if $_mixed is a Cue if ( is_object ( $ _mixed ) && class_exists ( get_class ( $ _mixed ) ) && class_exists ( __NAMESPACE__ . '\Cue' ) && is_subclass_of ( $ _mixed , __NAMESPACE__ . '\Cue' ) ) { $ cueFormat = Cue :: getFormat ( $ _mixed ) ; if ( $ cueFormat !== $ fileFormat ) { throw new \ Exception ( "Can't add a $cueFormat cue in a $fileFormat file." ) ; } $ _mixed -> setLineEnding ( $ this -> lineEnding ) ; $ this -> cues [ ] = $ _mixed ; } else { $ cueClass = self :: getExpectedCueClass ( $ this ) ; $ cue = new $ cueClass ( $ _start , $ _stop , $ _mixed ) ; $ cue -> setLineEnding ( $ this -> lineEnding ) ; $ this -> cues [ ] = $ cue ; } return $ this ; }
Add a cue

@param mixed  $_mixed An cue instance or a string representing the text
@param string $_start A timecode
@param string $_stop  A timecode

@throws \Exception
@return File
Add a cue