@@ -57,9 +57,9 @@ discard block |
||
57 | 57 | throw new \Exception('missing IObjectStore instance'); |
58 | 58 | } |
59 | 59 | if (isset($params['storageid'])) { |
60 | - $this->id = 'object::store:' . $params['storageid']; |
|
60 | + $this->id = 'object::store:'.$params['storageid']; |
|
61 | 61 | } else { |
62 | - $this->id = 'object::store:' . $this->objectStore->getStorageId(); |
|
62 | + $this->id = 'object::store:'.$this->objectStore->getStorageId(); |
|
63 | 63 | } |
64 | 64 | if (isset($params['objectPrefix'])) { |
65 | 65 | $this->objectPrefix = $params['objectPrefix']; |
@@ -193,7 +193,7 @@ discard block |
||
193 | 193 | if ($ex->getCode() !== 404) { |
194 | 194 | $this->logger->logException($ex, [ |
195 | 195 | 'app' => 'objectstore', |
196 | - 'message' => 'Could not delete object ' . $this->getURN($stat['fileid']) . ' for ' . $path, |
|
196 | + 'message' => 'Could not delete object '.$this->getURN($stat['fileid']).' for '.$path, |
|
197 | 197 | ]); |
198 | 198 | return false; |
199 | 199 | } |
@@ -225,7 +225,7 @@ discard block |
||
225 | 225 | */ |
226 | 226 | protected function getURN($fileId) { |
227 | 227 | if (is_numeric($fileId)) { |
228 | - return $this->objectPrefix . $fileId; |
|
228 | + return $this->objectPrefix.$fileId; |
|
229 | 229 | } |
230 | 230 | return null; |
231 | 231 | } |
@@ -279,13 +279,13 @@ discard block |
||
279 | 279 | } catch (NotFoundException $e) { |
280 | 280 | $this->logger->logException($e, [ |
281 | 281 | 'app' => 'objectstore', |
282 | - 'message' => 'Could not get object ' . $this->getURN($stat['fileid']) . ' for file ' . $path, |
|
282 | + 'message' => 'Could not get object '.$this->getURN($stat['fileid']).' for file '.$path, |
|
283 | 283 | ]); |
284 | 284 | throw $e; |
285 | 285 | } catch (\Exception $ex) { |
286 | 286 | $this->logger->logException($ex, [ |
287 | 287 | 'app' => 'objectstore', |
288 | - 'message' => 'Could not get object ' . $this->getURN($stat['fileid']) . ' for file ' . $path, |
|
288 | + 'message' => 'Could not get object '.$this->getURN($stat['fileid']).' for file '.$path, |
|
289 | 289 | ]); |
290 | 290 | return false; |
291 | 291 | } |
@@ -298,7 +298,7 @@ discard block |
||
298 | 298 | case 'wb+': |
299 | 299 | $tmpFile = \OC::$server->getTempManager()->getTemporaryFile($ext); |
300 | 300 | $handle = fopen($tmpFile, $mode); |
301 | - return CallbackWrapper::wrap($handle, null, null, function () use ($path, $tmpFile) { |
|
301 | + return CallbackWrapper::wrap($handle, null, null, function() use ($path, $tmpFile) { |
|
302 | 302 | $this->writeBack($tmpFile, $path); |
303 | 303 | }); |
304 | 304 | case 'a': |
@@ -315,7 +315,7 @@ discard block |
||
315 | 315 | file_put_contents($tmpFile, $source); |
316 | 316 | } |
317 | 317 | $handle = fopen($tmpFile, $mode); |
318 | - return CallbackWrapper::wrap($handle, null, null, function () use ($path, $tmpFile) { |
|
318 | + return CallbackWrapper::wrap($handle, null, null, function() use ($path, $tmpFile) { |
|
319 | 319 | $this->writeBack($tmpFile, $path); |
320 | 320 | }); |
321 | 321 | } |
@@ -324,7 +324,7 @@ discard block |
||
324 | 324 | |
325 | 325 | public function file_exists($path) { |
326 | 326 | $path = $this->normalizePath($path); |
327 | - return (bool)$this->stat($path); |
|
327 | + return (bool) $this->stat($path); |
|
328 | 328 | } |
329 | 329 | |
330 | 330 | public function rename($source, $target) { |
@@ -381,7 +381,7 @@ discard block |
||
381 | 381 | } catch (\Exception $ex) { |
382 | 382 | $this->logger->logException($ex, [ |
383 | 383 | 'app' => 'objectstore', |
384 | - 'message' => 'Could not create object for ' . $path, |
|
384 | + 'message' => 'Could not create object for '.$path, |
|
385 | 385 | ]); |
386 | 386 | throw $ex; |
387 | 387 | } |
@@ -426,7 +426,7 @@ discard block |
||
426 | 426 | } |
427 | 427 | // update stat with new data |
428 | 428 | $mTime = time(); |
429 | - $stat['size'] = (int)$size; |
|
429 | + $stat['size'] = (int) $size; |
|
430 | 430 | $stat['mtime'] = $mTime; |
431 | 431 | $stat['storage_mtime'] = $mTime; |
432 | 432 | |
@@ -437,13 +437,13 @@ discard block |
||
437 | 437 | $stat['etag'] = $this->getETag($path); |
438 | 438 | |
439 | 439 | $exists = $this->getCache()->inCache($path); |
440 | - $uploadPath = $exists ? $path : $path . '.part'; |
|
440 | + $uploadPath = $exists ? $path : $path.'.part'; |
|
441 | 441 | $fileId = $this->getCache()->put($uploadPath, $stat); |
442 | 442 | $urn = $this->getURN($fileId); |
443 | 443 | try { |
444 | 444 | //upload to object storage |
445 | 445 | if ($size === null) { |
446 | - $countStream = CountReadStream::wrap($stream, function ($writtenSize) use ($fileId, &$size) { |
|
446 | + $countStream = CountReadStream::wrap($stream, function($writtenSize) use ($fileId, &$size) { |
|
447 | 447 | $this->getCache()->update($fileId, [ |
448 | 448 | 'size' => $writtenSize |
449 | 449 | ]); |
@@ -460,7 +460,7 @@ discard block |
||
460 | 460 | $this->getCache()->remove($uploadPath); |
461 | 461 | $this->logger->logException($ex, [ |
462 | 462 | 'app' => 'objectstore', |
463 | - 'message' => 'Could not create object ' . $urn . ' for ' . $path, |
|
463 | + 'message' => 'Could not create object '.$urn.' for '.$path, |
|
464 | 464 | ]); |
465 | 465 | throw $ex; // make this bubble up |
466 | 466 | } |