src/Dropbox/Dropbox.php
public function makeDropboxFile($dropboxFile, $maxLength = null, $offset = null, $mode = DropboxFile::MODE_READ)
    {
        //Uploading file by file path
        if (!$dropboxFile instanceof DropboxFile) {
            //Create a DropboxFile Object
            $dropboxFile = new DropboxFile($dropboxFile, $mode);
        } elseif ($mode !== $dropboxFile->getMode()) {
            //Reopen the file with expected mode
            $dropboxFile->close();
            $dropboxFile = new DropboxFile($dropboxFile->getFilePath(), $mode);
        }

        if (!is_null($offset)) {
            $dropboxFile->setOffset($offset);
        }

        if (!is_null($maxLength)) {
            $dropboxFile->setMaxLength($maxLength);
        }

        //Return the DropboxFile Object
        return $dropboxFile;
    }
public function makeDropboxFile($dropboxFile, $maxLength = null, $offset = null, $mode = DropboxFile::MODE_READ)
    {
        //Uploading file by file path
        if (!$dropboxFile instanceof DropboxFile) {
            //Create a DropboxFile Object
            $dropboxFile = new DropboxFile($dropboxFile, $mode);
        } elseif ($mode !== $dropboxFile->getMode()) {
            //Reopen the file with expected mode
            $dropboxFile->close();
            $dropboxFile = new DropboxFile($dropboxFile->getFilePath(), $mode);
        }

        if (!is_null($offset)) {
            $dropboxFile->setOffset($offset);
        }

        if (!is_null($maxLength)) {
            $dropboxFile->setMaxLength($maxLength);
        }

        //Return the DropboxFile Object
        return $dropboxFile;
    }
public function makeDropboxFile ( $ dropboxFile , $ maxLength = null , $ offset = null , $ mode = DropboxFile :: MODE_READ ) { //Uploading file by file path if ( ! $ dropboxFile instanceof DropboxFile ) { //Create a DropboxFile Object $ dropboxFile = new DropboxFile ( $ dropboxFile , $ mode ) ; } elseif ( $ mode !== $ dropboxFile -> getMode ( ) ) { //Reopen the file with expected mode $ dropboxFile -> close ( ) ; $ dropboxFile = new DropboxFile ( $ dropboxFile -> getFilePath ( ) , $ mode ) ; } if ( ! is_null ( $ offset ) ) { $ dropboxFile -> setOffset ( $ offset ) ; } if ( ! is_null ( $ maxLength ) ) { $ dropboxFile -> setMaxLength ( $ maxLength ) ; } //Return the DropboxFile Object return $ dropboxFile ; }
Make DropboxFile Object

@param  string|DropboxFile $dropboxFile DropboxFile object or Path to file
@param  int                $maxLength   Max Bytes to read from the file
@param  int                $offset      Seek to specified offset before reading
@param  string             $mode        The type of access

@return \Kunnu\Dropbox\DropboxFile
Make DropboxFile Object