Code style and doc fix

This commit is contained in:
Piotr Filiciak 2016-05-23 15:17:00 +02:00 committed by Vincent Petry
parent f29f85709a
commit 7a791c5472
No known key found for this signature in database
GPG Key ID: AF8F9EFC56562186
3 changed files with 11 additions and 10 deletions

View File

@ -51,16 +51,16 @@ class OC_Files {
const UPLOAD_MIN_LIMIT_BYTES = 1048576; // 1 MiB
private static $MULTIPART_BOUNDARY = '';
private static $multipartBoundary = '';
/**
* @return string
*/
private static function getBoundary() {
if (empty(self::$MULTIPART_BOUNDARY)) {
self::$MULTIPART_BOUNDARY = md5(mt_rand());
if (empty(self::$multipartBoundary)) {
self::$multipartBoundary = md5(mt_rand());
}
return self::$MULTIPART_BOUNDARY;
return self::$multipartBoundary;
}
/**
@ -101,7 +101,7 @@ class OC_Files {
* @param string $files ; separated list of files to download
* @param array $params ; 'head' boolean to only send header of the request ; 'range' http range header
*/
public static function get($dir, $files, $params = array( 'head' => false )) {
public static function get($dir, $files, $params = null) {
$view = \OC\Files\Filesystem::getView();
$getType = self::FILE;
@ -115,7 +115,7 @@ class OC_Files {
if (!is_array($files)) {
$filename = $dir . '/' . $files;
if (!$view->is_dir($filename)) {
self::getSingleFile($view, $dir, $files, $params);
self::getSingleFile($view, $dir, $files, is_null($params) ? array() : $params);
return;
}
}

View File

@ -429,7 +429,8 @@ class View {
* @param int $from
* @param int $to
* @return bool|mixed
* @throws \OCP\Files\InvalidPathException, \OCP\Files\UnseekableException
* @throws \OCP\Files\InvalidPathException
* @throws \OCP\Files\UnseekableException
*/
public function readfilePart($path, $from, $to) {
$this->assertPathLength($path);
@ -450,9 +451,8 @@ class View {
$size = ftell($handle) - $from;
return $size;
}
else {
throw new \OCP\Files\UnseekableException('fseek error');
}
throw new \OCP\Files\UnseekableException('fseek error');
}
return false;
}

View File

@ -30,5 +30,6 @@ namespace OCP\Files;
/**
* Exception for seek problem
* @since 9.1.0
*/
class UnseekableException extends \Exception {}