@@ -42,7 +42,7 @@ |
||
| 42 | 42 | $subFolders = explode('/', $relativePath); |
| 43 | 43 | |
| 44 | 44 | if (count($subFolders) > 2) { |
| 45 | - $reducedPath = $currFolderPath . $subFolders[0] . '/' . array_pop($subFolders); |
|
| 45 | + $reducedPath = $currFolderPath.$subFolders[0].'/'.array_pop($subFolders); |
|
| 46 | 46 | } else { |
| 47 | 47 | $reducedPath = $path; |
| 48 | 48 | } |
@@ -149,7 +149,7 @@ |
||
| 149 | 149 | */ |
| 150 | 150 | private function redirectToErrorPage($message, $code) { |
| 151 | 151 | $url = $this->urlGenerator->linkToRoute( |
| 152 | - $this->appName . '.page.error_page', ['code' => $code] |
|
| 152 | + $this->appName.'.page.error_page', ['code' => $code] |
|
| 153 | 153 | ); |
| 154 | 154 | |
| 155 | 155 | $response = new RedirectResponse($url); |
@@ -29,7 +29,7 @@ |
||
| 29 | 29 | * @param int $code the HTTP status code |
| 30 | 30 | */ |
| 31 | 31 | public function __construct($msg, $code = 0) { |
| 32 | - Util::writeLog('gallery', 'Exception: ' . $msg . ' (' . $code . ')', Util::ERROR); |
|
| 32 | + Util::writeLog('gallery', 'Exception: '.$msg.' ('.$code.')', Util::ERROR); |
|
| 33 | 33 | parent::__construct($msg, $code); |
| 34 | 34 | } |
| 35 | 35 | |
@@ -180,7 +180,7 @@ discard block |
||
| 180 | 180 | ) { |
| 181 | 181 | $message = |
| 182 | 182 | 'Passed token seems to be valid, but it does not contain all necessary information . ("' |
| 183 | - . $token . '")'; |
|
| 183 | + . $token.'")'; |
|
| 184 | 184 | throw new CheckException($message, Http::STATUS_NOT_FOUND); |
| 185 | 185 | } |
| 186 | 186 | } |
@@ -194,7 +194,7 @@ discard block |
||
| 194 | 194 | */ |
| 195 | 195 | private function checkItemType($share) { |
| 196 | 196 | if ($share->getNodeType() === null) { |
| 197 | - $message = 'No item type set for share id: ' . $share->getId(); |
|
| 197 | + $message = 'No item type set for share id: '.$share->getId(); |
|
| 198 | 198 | throw new CheckException($message, Http::STATUS_NOT_FOUND); |
| 199 | 199 | } |
| 200 | 200 | } |
@@ -236,7 +236,7 @@ discard block |
||
| 236 | 236 | $this->checkPassword($share, $password); |
| 237 | 237 | } else { |
| 238 | 238 | throw new CheckException( |
| 239 | - 'Unknown share type ' . $share->getShareType() . ' for share id ' |
|
| 239 | + 'Unknown share type '.$share->getShareType().' for share id ' |
|
| 240 | 240 | . $share->getId(), Http::STATUS_NOT_FOUND |
| 241 | 241 | ); |
| 242 | 242 | } |
@@ -32,8 +32,8 @@ discard block |
||
| 32 | 32 | |
| 33 | 33 | switch ($key) { |
| 34 | 34 | case 'sorting': |
| 35 | - $safe = $this->isSortingSafe('type',$parsedConfigItem, $safe); |
|
| 36 | - $safe = $this->isSortingSafe('order',$parsedConfigItem, $safe); |
|
| 35 | + $safe = $this->isSortingSafe('type', $parsedConfigItem, $safe); |
|
| 36 | + $safe = $this->isSortingSafe('order', $parsedConfigItem, $safe); |
|
| 37 | 37 | break; |
| 38 | 38 | case 'design': |
| 39 | 39 | $safe = $this->isDesignColourSafe($parsedConfigItem, $safe); |
@@ -50,9 +50,9 @@ discard block |
||
| 50 | 50 | * @param bool $safe whether the current config has been deemed safe to use so far |
| 51 | 51 | * @return bool |
| 52 | 52 | */ |
| 53 | - private function isSortingSafe($key,$parsedConfigItem, $safe) { |
|
| 53 | + private function isSortingSafe($key, $parsedConfigItem, $safe) { |
|
| 54 | 54 | if ($safe && array_key_exists($key, $parsedConfigItem)) { |
| 55 | - $safe = $safe && $this->sortingValidator($key, $parsedConfigItem[ $key ]); |
|
| 55 | + $safe = $safe && $this->sortingValidator($key, $parsedConfigItem[$key]); |
|
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | return $safe; |
@@ -25,7 +25,7 @@ |
||
| 25 | 25 | * @param string $msg the message contained in the exception |
| 26 | 26 | */ |
| 27 | 27 | public function __construct($msg) { |
| 28 | - Util::writeLog('gallery', 'Exception: ' . $msg, Util::ERROR); |
|
| 28 | + Util::writeLog('gallery', 'Exception: '.$msg, Util::ERROR); |
|
| 29 | 29 | parent::__construct($msg); |
| 30 | 30 | } |
| 31 | 31 | } |
@@ -38,10 +38,10 @@ |
||
| 38 | 38 | $this->preview = $image['preview']; |
| 39 | 39 | |
| 40 | 40 | $this->setStatus($statusCode); |
| 41 | - $this->addHeader('Content-type', $image['mimetype'] . '; charset=utf-8'); |
|
| 41 | + $this->addHeader('Content-type', $image['mimetype'].'; charset=utf-8'); |
|
| 42 | 42 | $this->addHeader('Content-Disposition', |
| 43 | - 'attachment; filename*=UTF-8\'\'' . rawurlencode($name) . '; filename="' |
|
| 44 | - . rawurlencode($name) . '"' |
|
| 43 | + 'attachment; filename*=UTF-8\'\''.rawurlencode($name).'; filename="' |
|
| 44 | + . rawurlencode($name).'"' |
|
| 45 | 45 | ); |
| 46 | 46 | } |
| 47 | 47 | |
@@ -14,11 +14,11 @@ discard block |
||
| 14 | 14 | |
| 15 | 15 | ini_set("gd.jpeg_ignore_warning", true); |
| 16 | 16 | |
| 17 | -require_once __DIR__ . '/../../vendor/autoload.php'; |
|
| 17 | +require_once __DIR__.'/../../vendor/autoload.php'; |
|
| 18 | 18 | |
| 19 | 19 | // A production environment will not have xdebug enabled and |
| 20 | 20 | // a development environment should have the dev packages installed |
| 21 | -$c3 = __DIR__ . '/../../c3.php'; |
|
| 21 | +$c3 = __DIR__.'/../../c3.php'; |
|
| 22 | 22 | if (extension_loaded('xdebug') && file_exists($c3)) { |
| 23 | 23 | include_once $c3; |
| 24 | 24 | } |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | * Controllers |
| 74 | 74 | */ |
| 75 | 75 | $container->registerService( |
| 76 | - 'PageController', function (IContainer $c) { |
|
| 76 | + 'PageController', function(IContainer $c) { |
|
| 77 | 77 | return new PageController( |
| 78 | 78 | $c->query('AppName'), |
| 79 | 79 | $c->query('Request'), |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | } |
| 86 | 86 | ); |
| 87 | 87 | $container->registerService( |
| 88 | - 'ConfigController', function (IContainer $c) { |
|
| 88 | + 'ConfigController', function(IContainer $c) { |
|
| 89 | 89 | return new ConfigController( |
| 90 | 90 | $c->query('AppName'), |
| 91 | 91 | $c->query('Request'), |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | } |
| 96 | 96 | ); |
| 97 | 97 | $container->registerService( |
| 98 | - 'ConfigPublicController', function (IContainer $c) { |
|
| 98 | + 'ConfigPublicController', function(IContainer $c) { |
|
| 99 | 99 | return new ConfigPublicController( |
| 100 | 100 | $c->query('AppName'), |
| 101 | 101 | $c->query('Request'), |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | } |
| 106 | 106 | ); |
| 107 | 107 | $container->registerService( |
| 108 | - 'ConfigApiController', function (IContainer $c) { |
|
| 108 | + 'ConfigApiController', function(IContainer $c) { |
|
| 109 | 109 | return new ConfigApiController( |
| 110 | 110 | $c->query('AppName'), |
| 111 | 111 | $c->query('Request'), |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | } |
| 116 | 116 | ); |
| 117 | 117 | $container->registerService( |
| 118 | - 'FilesController', function (IContainer $c) { |
|
| 118 | + 'FilesController', function(IContainer $c) { |
|
| 119 | 119 | return new FilesController( |
| 120 | 120 | $c->query('AppName'), |
| 121 | 121 | $c->query('Request'), |
@@ -129,7 +129,7 @@ discard block |
||
| 129 | 129 | } |
| 130 | 130 | ); |
| 131 | 131 | $container->registerService( |
| 132 | - 'FilesPublicController', function (IContainer $c) { |
|
| 132 | + 'FilesPublicController', function(IContainer $c) { |
|
| 133 | 133 | return new FilesPublicController( |
| 134 | 134 | $c->query('AppName'), |
| 135 | 135 | $c->query('Request'), |
@@ -143,7 +143,7 @@ discard block |
||
| 143 | 143 | } |
| 144 | 144 | ); |
| 145 | 145 | $container->registerService( |
| 146 | - 'FilesApiController', function (IContainer $c) { |
|
| 146 | + 'FilesApiController', function(IContainer $c) { |
|
| 147 | 147 | return new FilesApiController( |
| 148 | 148 | $c->query('AppName'), |
| 149 | 149 | $c->query('Request'), |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | } |
| 158 | 158 | ); |
| 159 | 159 | $container->registerService( |
| 160 | - 'PreviewController', function (IContainer $c) { |
|
| 160 | + 'PreviewController', function(IContainer $c) { |
|
| 161 | 161 | return new PreviewController( |
| 162 | 162 | $c->query('AppName'), |
| 163 | 163 | $c->query('Request'), |
@@ -172,7 +172,7 @@ discard block |
||
| 172 | 172 | } |
| 173 | 173 | ); |
| 174 | 174 | $container->registerService( |
| 175 | - 'PreviewPublicController', function (IContainer $c) { |
|
| 175 | + 'PreviewPublicController', function(IContainer $c) { |
|
| 176 | 176 | return new PreviewPublicController( |
| 177 | 177 | $c->query('AppName'), |
| 178 | 178 | $c->query('Request'), |
@@ -187,7 +187,7 @@ discard block |
||
| 187 | 187 | } |
| 188 | 188 | ); |
| 189 | 189 | $container->registerService( |
| 190 | - 'PreviewApiController', function (IContainer $c) { |
|
| 190 | + 'PreviewApiController', function(IContainer $c) { |
|
| 191 | 191 | return new PreviewApiController( |
| 192 | 192 | $c->query('AppName'), |
| 193 | 193 | $c->query('Request'), |
@@ -206,30 +206,30 @@ discard block |
||
| 206 | 206 | * Core |
| 207 | 207 | */ |
| 208 | 208 | $container->registerService( |
| 209 | - 'EventSource', function (IAppContainer $c) { |
|
| 209 | + 'EventSource', function(IAppContainer $c) { |
|
| 210 | 210 | return new EventSource(); |
| 211 | 211 | } |
| 212 | 212 | ); |
| 213 | 213 | $container->registerService( |
| 214 | - 'Token', function (IContainer $c) { |
|
| 214 | + 'Token', function(IContainer $c) { |
|
| 215 | 215 | return $c->query('Request') |
| 216 | 216 | ->getParam('token'); |
| 217 | 217 | } |
| 218 | 218 | ); |
| 219 | 219 | $container->registerService( |
| 220 | - 'Session', function (IAppContainer $c) { |
|
| 220 | + 'Session', function(IAppContainer $c) { |
|
| 221 | 221 | return $c->getServer() |
| 222 | 222 | ->getSession(); |
| 223 | 223 | } |
| 224 | 224 | ); |
| 225 | 225 | $container->registerService( |
| 226 | - 'L10N', function (IAppContainer $c) { |
|
| 226 | + 'L10N', function(IAppContainer $c) { |
|
| 227 | 227 | return $c->getServer() |
| 228 | 228 | ->getL10N('gallery'); // Keep the same translations |
| 229 | 229 | } |
| 230 | 230 | ); |
| 231 | 231 | $container->registerService( |
| 232 | - 'UserFolder', function (IAppContainer $c) { |
|
| 232 | + 'UserFolder', function(IAppContainer $c) { |
|
| 233 | 233 | return $c->getServer() |
| 234 | 234 | ->getUserFolder($c->query('UserId')); |
| 235 | 235 | } |
@@ -239,12 +239,12 @@ discard block |
||
| 239 | 239 | * OCA |
| 240 | 240 | */ |
| 241 | 241 | $container->registerService( |
| 242 | - 'ConfigParser', function () { |
|
| 242 | + 'ConfigParser', function() { |
|
| 243 | 243 | return new ConfigParser(); |
| 244 | 244 | } |
| 245 | 245 | ); |
| 246 | 246 | $container->registerService( |
| 247 | - 'Environment', function (IContainer $c) { |
|
| 247 | + 'Environment', function(IContainer $c) { |
|
| 248 | 248 | return new Environment( |
| 249 | 249 | $c->query('AppName'), |
| 250 | 250 | $c->query('UserId'), |
@@ -271,14 +271,14 @@ discard block |
||
| 271 | 271 | if (\OCP\App::isEnabled('ocutility')) { |
| 272 | 272 | // @codeCoverageIgnoreStart |
| 273 | 273 | $container->registerService( |
| 274 | - 'UtilityContainer', function () { |
|
| 274 | + 'UtilityContainer', function() { |
|
| 275 | 275 | $app = new OcUtility(); |
| 276 | 276 | |
| 277 | 277 | return $app->getContainer(); |
| 278 | 278 | } |
| 279 | 279 | ); |
| 280 | 280 | $container->registerService( |
| 281 | - 'Helper', function (IContainer $c) { |
|
| 281 | + 'Helper', function(IContainer $c) { |
|
| 282 | 282 | return $c->query('UtilityContainer') |
| 283 | 283 | ->query('OCA\OcUtility\Service\Helper'); |
| 284 | 284 | } |
@@ -286,7 +286,7 @@ discard block |
||
| 286 | 286 | } else { |
| 287 | 287 | // @codeCoverageIgnoreEnd |
| 288 | 288 | $container->registerService( |
| 289 | - 'Logger', function (IContainer $c) { |
|
| 289 | + 'Logger', function(IContainer $c) { |
|
| 290 | 290 | return $c->query('OCP\ILogger'); |
| 291 | 291 | } |
| 292 | 292 | ); |
@@ -295,7 +295,7 @@ discard block |
||
| 295 | 295 | * Services |
| 296 | 296 | */ |
| 297 | 297 | $container->registerService( |
| 298 | - 'SearchFolderService', function (IContainer $c) { |
|
| 298 | + 'SearchFolderService', function(IContainer $c) { |
|
| 299 | 299 | return new SearchFolderService( |
| 300 | 300 | $c->query('AppName'), |
| 301 | 301 | $c->query('Environment'), |
@@ -304,7 +304,7 @@ discard block |
||
| 304 | 304 | } |
| 305 | 305 | ); |
| 306 | 306 | $container->registerService( |
| 307 | - 'ConfigService', function (IContainer $c) { |
|
| 307 | + 'ConfigService', function(IContainer $c) { |
|
| 308 | 308 | return new ConfigService( |
| 309 | 309 | $c->query('AppName'), |
| 310 | 310 | $c->query('Environment'), |
@@ -315,7 +315,7 @@ discard block |
||
| 315 | 315 | } |
| 316 | 316 | ); |
| 317 | 317 | $container->registerService( |
| 318 | - 'SearchMediaService', function (IContainer $c) { |
|
| 318 | + 'SearchMediaService', function(IContainer $c) { |
|
| 319 | 319 | return new SearchMediaService( |
| 320 | 320 | $c->query('AppName'), |
| 321 | 321 | $c->query('Environment'), |
@@ -324,12 +324,12 @@ discard block |
||
| 324 | 324 | } |
| 325 | 325 | ); |
| 326 | 326 | $container->registerService( |
| 327 | - 'ThumbnailService', function () { |
|
| 327 | + 'ThumbnailService', function() { |
|
| 328 | 328 | return new ThumbnailService(); |
| 329 | 329 | } |
| 330 | 330 | ); |
| 331 | 331 | $container->registerService( |
| 332 | - 'PreviewService', function (IContainer $c) { |
|
| 332 | + 'PreviewService', function(IContainer $c) { |
|
| 333 | 333 | return new PreviewService( |
| 334 | 334 | $c->query('AppName'), |
| 335 | 335 | $c->query('Environment'), |
@@ -339,7 +339,7 @@ discard block |
||
| 339 | 339 | } |
| 340 | 340 | ); |
| 341 | 341 | $container->registerService( |
| 342 | - 'DownloadService', function (IContainer $c) { |
|
| 342 | + 'DownloadService', function(IContainer $c) { |
|
| 343 | 343 | return new DownloadService( |
| 344 | 344 | $c->query('AppName'), |
| 345 | 345 | $c->query('Environment'), |
@@ -353,7 +353,7 @@ discard block |
||
| 353 | 353 | */ |
| 354 | 354 | $container->registerService( |
| 355 | 355 | 'SharingCheckMiddleware', |
| 356 | - function (IAppContainer $c) { |
|
| 356 | + function(IAppContainer $c) { |
|
| 357 | 357 | return new SharingCheckMiddleware( |
| 358 | 358 | $c->query('AppName'), |
| 359 | 359 | $c->query('Request'), |
@@ -366,7 +366,7 @@ discard block |
||
| 366 | 366 | ); |
| 367 | 367 | $container->registerService( |
| 368 | 368 | 'EnvCheckMiddleware', |
| 369 | - function (IContainer $c) { |
|
| 369 | + function(IContainer $c) { |
|
| 370 | 370 | return new EnvCheckMiddleware( |
| 371 | 371 | $c->query('AppName'), |
| 372 | 372 | $c->query('Request'), |
@@ -143,7 +143,7 @@ discard block |
||
| 143 | 143 | * without having to know whether they're private or public |
| 144 | 144 | */ |
| 145 | 145 | public function setStandardEnv() { |
| 146 | - $this->fromRootToFolder = $this->userFolder->getPath() . '/'; |
|
| 146 | + $this->fromRootToFolder = $this->userFolder->getPath().'/'; |
|
| 147 | 147 | } |
| 148 | 148 | |
| 149 | 149 | /** |
@@ -164,7 +164,7 @@ discard block |
||
| 164 | 164 | */ |
| 165 | 165 | public function getNodeFromVirtualRoot($subPath) { |
| 166 | 166 | $relativePath = $this->getRelativePath($this->fromRootToFolder); |
| 167 | - $path = $relativePath . '/' . $subPath; |
|
| 167 | + $path = $relativePath.'/'.$subPath; |
|
| 168 | 168 | $node = $this->getNodeFromUserFolder($path); |
| 169 | 169 | |
| 170 | 170 | return $this->getResourceFromId($node->getId()); |
@@ -190,7 +190,7 @@ discard block |
||
| 190 | 190 | try { |
| 191 | 191 | $node = $folder->get($path); |
| 192 | 192 | } catch (NotFoundException $exception) { |
| 193 | - $message = 'Could not find anything at: ' . $exception->getMessage(); |
|
| 193 | + $message = 'Could not find anything at: '.$exception->getMessage(); |
|
| 194 | 194 | throw new NotFoundEnvException($message); |
| 195 | 195 | } |
| 196 | 196 | } |
@@ -244,7 +244,7 @@ discard block |
||
| 244 | 244 | if ($nodeType === 'dir') { |
| 245 | 245 | $rootFolder = $node; |
| 246 | 246 | } else { |
| 247 | - throw new NotFoundEnvException($node->getPath() . ' is not a folder'); |
|
| 247 | + throw new NotFoundEnvException($node->getPath().' is not a folder'); |
|
| 248 | 248 | } |
| 249 | 249 | } |
| 250 | 250 | |
@@ -358,7 +358,7 @@ discard block |
||
| 358 | 358 | $resourcesArray = $folder->getById($resourceId); |
| 359 | 359 | |
| 360 | 360 | if (!isset($resourcesArray[0])) { |
| 361 | - throw new NotFoundEnvException('Could not locate node linked to ID: ' . $resourceId); |
|
| 361 | + throw new NotFoundEnvException('Could not locate node linked to ID: '.$resourceId); |
|
| 362 | 362 | } |
| 363 | 363 | |
| 364 | 364 | return $resourcesArray[0]; |
@@ -376,7 +376,7 @@ discard block |
||
| 376 | 376 | */ |
| 377 | 377 | private function buildFromRootToFolder($fileSource) { |
| 378 | 378 | $resource = $this->getResourceFromId($fileSource); |
| 379 | - $fromRootToFolder = $resource->getPath() . '/'; |
|
| 379 | + $fromRootToFolder = $resource->getPath().'/'; |
|
| 380 | 380 | |
| 381 | 381 | return $fromRootToFolder; |
| 382 | 382 | } |
@@ -396,7 +396,7 @@ discard block |
||
| 396 | 396 | * @return string |
| 397 | 397 | */ |
| 398 | 398 | private function getRelativePath($fullPath) { |
| 399 | - $folderPath = $this->userFolder->getPath() . '/'; |
|
| 399 | + $folderPath = $this->userFolder->getPath().'/'; |
|
| 400 | 400 | $origShareRelPath = str_replace($folderPath, '', $fullPath); |
| 401 | 401 | |
| 402 | 402 | return $origShareRelPath; |