@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | try { |
| 123 | 123 | $this->prepareUpload($request->getPath()); |
| 124 | 124 | $this->checkPrerequisites(false); |
| 125 | - } catch (BadRequest|StorageInvalidException|NotFound $e) { |
|
| 125 | + } catch (BadRequest | StorageInvalidException | NotFound $e) { |
|
| 126 | 126 | return true; |
| 127 | 127 | } |
| 128 | 128 | |
@@ -146,14 +146,14 @@ discard block |
||
| 146 | 146 | try { |
| 147 | 147 | $this->prepareUpload(dirname($request->getPath())); |
| 148 | 148 | $this->checkPrerequisites(); |
| 149 | - } catch (StorageInvalidException|BadRequest|NotFound $e) { |
|
| 149 | + } catch (StorageInvalidException | BadRequest | NotFound $e) { |
|
| 150 | 150 | return true; |
| 151 | 151 | } |
| 152 | 152 | |
| 153 | 153 | [$storage, $storagePath] = $this->getUploadStorage($this->uploadPath); |
| 154 | 154 | |
| 155 | 155 | $chunkName = basename($request->getPath()); |
| 156 | - $partId = is_numeric($chunkName) ? (int)$chunkName : -1; |
|
| 156 | + $partId = is_numeric($chunkName) ? (int) $chunkName : -1; |
|
| 157 | 157 | if (!($partId >= 1 && $partId <= 10000)) { |
| 158 | 158 | throw new BadRequest('Invalid chunk name, must be numeric between 1 and 10000'); |
| 159 | 159 | } |
@@ -161,7 +161,7 @@ discard block |
||
| 161 | 161 | $uploadFile = $this->getUploadFile($this->uploadPath); |
| 162 | 162 | $tempTargetFile = null; |
| 163 | 163 | |
| 164 | - $additionalSize = (int)$request->getHeader('Content-Length'); |
|
| 164 | + $additionalSize = (int) $request->getHeader('Content-Length'); |
|
| 165 | 165 | if ($this->uploadFolder->childExists(self::TEMP_TARGET) && $this->uploadPath) { |
| 166 | 166 | /** @var UploadFile $tempTargetFile */ |
| 167 | 167 | $tempTargetFile = $this->uploadFolder->getChild(self::TEMP_TARGET); |
@@ -176,7 +176,7 @@ discard block |
||
| 176 | 176 | } |
| 177 | 177 | |
| 178 | 178 | $stream = $request->getBodyAsStream(); |
| 179 | - $storage->putChunkedWritePart($storagePath, $this->uploadId, (string)$partId, $stream, $additionalSize); |
|
| 179 | + $storage->putChunkedWritePart($storagePath, $this->uploadId, (string) $partId, $stream, $additionalSize); |
|
| 180 | 180 | |
| 181 | 181 | $storage->getCache()->update($uploadFile->getId(), ['size' => $uploadFile->getSize() + $additionalSize]); |
| 182 | 182 | if ($tempTargetFile) { |
@@ -191,7 +191,7 @@ discard block |
||
| 191 | 191 | try { |
| 192 | 192 | $this->prepareUpload(dirname($sourcePath)); |
| 193 | 193 | $this->checkPrerequisites(); |
| 194 | - } catch (StorageInvalidException|BadRequest|NotFound|PreconditionFailed $e) { |
|
| 194 | + } catch (StorageInvalidException | BadRequest | NotFound | PreconditionFailed $e) { |
|
| 195 | 195 | return true; |
| 196 | 196 | } |
| 197 | 197 | [$storage, $storagePath] = $this->getUploadStorage($this->uploadPath); |
@@ -231,7 +231,7 @@ discard block |
||
| 231 | 231 | } |
| 232 | 232 | } |
| 233 | 233 | |
| 234 | - $destinationInView = $destinationParent->getFileInfo()->getPath() . '/' . $destinationName; |
|
| 234 | + $destinationInView = $destinationParent->getFileInfo()->getPath().'/'.$destinationName; |
|
| 235 | 235 | $this->completeChunkedWrite($destinationInView); |
| 236 | 236 | |
| 237 | 237 | $rootView = new View(); |
@@ -257,7 +257,7 @@ discard block |
||
| 257 | 257 | try { |
| 258 | 258 | $this->prepareUpload(dirname($request->getPath())); |
| 259 | 259 | $this->checkPrerequisites(); |
| 260 | - } catch (StorageInvalidException|BadRequest|NotFound $e) { |
|
| 260 | + } catch (StorageInvalidException | BadRequest | NotFound $e) { |
|
| 261 | 261 | return true; |
| 262 | 262 | } |
| 263 | 263 | |
@@ -300,7 +300,7 @@ discard block |
||
| 300 | 300 | throw new InvalidArgumentException('X-OC-MTime header must be an integer (unix timestamp).'); |
| 301 | 301 | } |
| 302 | 302 | |
| 303 | - return (int)$mtimeFromRequest; |
|
| 303 | + return (int) $mtimeFromRequest; |
|
| 304 | 304 | } |
| 305 | 305 | |
| 306 | 306 | /** |
@@ -333,7 +333,7 @@ discard block |
||
| 333 | 333 | |
| 334 | 334 | // If the file was not uploaded to the user storage directly we need to copy/move it |
| 335 | 335 | try { |
| 336 | - $uploadFileAbsolutePath = Filesystem::getRoot() . $uploadFile->getPath(); |
|
| 336 | + $uploadFileAbsolutePath = Filesystem::getRoot().$uploadFile->getPath(); |
|
| 337 | 337 | if ($uploadFileAbsolutePath !== $targetAbsolutePath) { |
| 338 | 338 | $uploadFile = $rootFolder->get($uploadFile->getFileInfo()->getPath()); |
| 339 | 339 | if ($exists) { |