public function addFile($file, $inArchiveName = null)
    {
        if (!is_file($file))
            throw new InvalidArgumentException($file.' is not a valid file to add in archive');

        return ($inArchiveName !== null
                ? $this->addFiles([$file => $inArchiveName])
                : $this->addFiles([$file])) === 1;
    }
public function addFile($file, $inArchiveName = null)
    {
        if (!is_file($file))
            throw new InvalidArgumentException($file.' is not a valid file to add in archive');

        return ($inArchiveName !== null
                ? $this->addFiles([$file => $inArchiveName])
                : $this->addFiles([$file])) === 1;
    }
public function addFile ( $ file , $ inArchiveName = null ) { if ( ! is_file ( $ file ) ) throw new InvalidArgumentException ( $ file . ' is not a valid file to add in archive' ) ; return ( $ inArchiveName !== null ? $ this -> addFiles ( [ $ file => $ inArchiveName ] ) : $ this -> addFiles ( [ $ file ] ) ) === 1 ; }
Adds file into archive
@param string $file
@param string|null $inArchiveName If not passed, full path will be preserved.
@return bool
@throws Exception
Adds file into archive