@@ -72,17 +72,17 @@ discard block |
||
| 72 | 72 | } |
| 73 | 73 | |
| 74 | 74 | protected function getStorageConfigFromDBMount(array $mount) { |
| 75 | - $applicableUsers = array_filter($mount['applicable'], function ($applicable) { |
|
| 75 | + $applicableUsers = array_filter($mount['applicable'], function($applicable) { |
|
| 76 | 76 | return $applicable['type'] === DBConfigService::APPLICABLE_TYPE_USER; |
| 77 | 77 | }); |
| 78 | - $applicableUsers = array_map(function ($applicable) { |
|
| 78 | + $applicableUsers = array_map(function($applicable) { |
|
| 79 | 79 | return $applicable['value']; |
| 80 | 80 | }, $applicableUsers); |
| 81 | 81 | |
| 82 | - $applicableGroups = array_filter($mount['applicable'], function ($applicable) { |
|
| 82 | + $applicableGroups = array_filter($mount['applicable'], function($applicable) { |
|
| 83 | 83 | return $applicable['type'] === DBConfigService::APPLICABLE_TYPE_GROUP; |
| 84 | 84 | }); |
| 85 | - $applicableGroups = array_map(function ($applicable) { |
|
| 85 | + $applicableGroups = array_map(function($applicable) { |
|
| 86 | 86 | return $applicable['value']; |
| 87 | 87 | }, $applicableGroups); |
| 88 | 88 | |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | $mount['priority'] |
| 99 | 99 | ); |
| 100 | 100 | $config->setType($mount['type']); |
| 101 | - $config->setId((int)$mount['mount_id']); |
|
| 101 | + $config->setId((int) $mount['mount_id']); |
|
| 102 | 102 | return $config; |
| 103 | 103 | } catch (\UnexpectedValueException $e) { |
| 104 | 104 | // don't die if a storage backend doesn't exist |
@@ -126,11 +126,11 @@ discard block |
||
| 126 | 126 | protected function readConfig() { |
| 127 | 127 | $mounts = $this->readDBConfig(); |
| 128 | 128 | $configs = array_map([$this, 'getStorageConfigFromDBMount'], $mounts); |
| 129 | - $configs = array_filter($configs, function ($config) { |
|
| 129 | + $configs = array_filter($configs, function($config) { |
|
| 130 | 130 | return $config instanceof StorageConfig; |
| 131 | 131 | }); |
| 132 | 132 | |
| 133 | - $keys = array_map(function (StorageConfig $config) { |
|
| 133 | + $keys = array_map(function(StorageConfig $config) { |
|
| 134 | 134 | return $config->getId(); |
| 135 | 135 | }, $configs); |
| 136 | 136 | |
@@ -149,14 +149,14 @@ discard block |
||
| 149 | 149 | $mount = $this->dbConfig->getMountById($id); |
| 150 | 150 | |
| 151 | 151 | if (!is_array($mount)) { |
| 152 | - throw new NotFoundException('Storage with ID "' . $id . '" not found'); |
|
| 152 | + throw new NotFoundException('Storage with ID "'.$id.'" not found'); |
|
| 153 | 153 | } |
| 154 | 154 | |
| 155 | 155 | $config = $this->getStorageConfigFromDBMount($mount); |
| 156 | 156 | if ($this->isApplicable($config)) { |
| 157 | 157 | return $config; |
| 158 | 158 | } else { |
| 159 | - throw new NotFoundException('Storage with ID "' . $id . '" not found'); |
|
| 159 | + throw new NotFoundException('Storage with ID "'.$id.'" not found'); |
|
| 160 | 160 | } |
| 161 | 161 | } |
| 162 | 162 | |
@@ -379,13 +379,13 @@ discard block |
||
| 379 | 379 | $existingMount = $this->dbConfig->getMountById($id); |
| 380 | 380 | |
| 381 | 381 | if (!is_array($existingMount)) { |
| 382 | - throw new NotFoundException('Storage with ID "' . $id . '" not found while updating storage'); |
|
| 382 | + throw new NotFoundException('Storage with ID "'.$id.'" not found while updating storage'); |
|
| 383 | 383 | } |
| 384 | 384 | |
| 385 | 385 | $oldStorage = $this->getStorageConfigFromDBMount($existingMount); |
| 386 | 386 | |
| 387 | 387 | if ($oldStorage->getBackend() instanceof InvalidBackend) { |
| 388 | - throw new NotFoundException('Storage with id "' . $id . '" cannot be edited due to missing backend'); |
|
| 388 | + throw new NotFoundException('Storage with id "'.$id.'" cannot be edited due to missing backend'); |
|
| 389 | 389 | } |
| 390 | 390 | |
| 391 | 391 | $removedUsers = array_diff($oldStorage->getApplicableUsers(), $updatedStorage->getApplicableUsers()); |
@@ -462,7 +462,7 @@ discard block |
||
| 462 | 462 | $existingMount = $this->dbConfig->getMountById($id); |
| 463 | 463 | |
| 464 | 464 | if (!is_array($existingMount)) { |
| 465 | - throw new NotFoundException('Storage with ID "' . $id . '" not found'); |
|
| 465 | + throw new NotFoundException('Storage with ID "'.$id.'" not found'); |
|
| 466 | 466 | } |
| 467 | 467 | |
| 468 | 468 | $this->dbConfig->removeMount($id); |
@@ -100,7 +100,7 @@ |
||
| 100 | 100 | |
| 101 | 101 | // casted to string because cast to float cause equality for non equal numbers |
| 102 | 102 | // and integer has the problem of limited size on 32 bit systems |
| 103 | - if ((string)$expectedSize !== (string)$actualSize) { |
|
| 103 | + if ((string) $expectedSize !== (string) $actualSize) { |
|
| 104 | 104 | throw new BadRequest("Chunks on server do not sum up to $expectedSize but to $actualSize bytes"); |
| 105 | 105 | } |
| 106 | 106 | } |
@@ -62,7 +62,7 @@ |
||
| 62 | 62 | */ |
| 63 | 63 | public function addEntityCollection(string $name, \Closure $entityExistsFunction) { |
| 64 | 64 | if (isset($this->collections[$name])) { |
| 65 | - throw new \OutOfBoundsException('Duplicate entity name "' . $name . '"'); |
|
| 65 | + throw new \OutOfBoundsException('Duplicate entity name "'.$name.'"'); |
|
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | $this->collections[$name] = $entityExistsFunction; |
@@ -67,6 +67,6 @@ |
||
| 67 | 67 | $implements |= Backend::COUNT_USERS; |
| 68 | 68 | } |
| 69 | 69 | |
| 70 | - return (bool)($actions & $implements); |
|
| 70 | + return (bool) ($actions & $implements); |
|
| 71 | 71 | } |
| 72 | 72 | } |
@@ -129,7 +129,7 @@ |
||
| 129 | 129 | $data = $result->fetchAll(); |
| 130 | 130 | $result->closeCursor(); |
| 131 | 131 | |
| 132 | - $entities = array_map(function ($row) { |
|
| 132 | + $entities = array_map(function($row) { |
|
| 133 | 133 | return PublicKeyToken::fromRow($row); |
| 134 | 134 | }, $data); |
| 135 | 135 | |
@@ -107,7 +107,7 @@ |
||
| 107 | 107 | * @return string language |
| 108 | 108 | * @since 7.0.0 |
| 109 | 109 | */ |
| 110 | - public function getLanguageCode(): string ; |
|
| 110 | + public function getLanguageCode(): string; |
|
| 111 | 111 | |
| 112 | 112 | /** |
| 113 | 113 | * * The code (en_US, fr_CA, ...) of the locale that is used for this IL10N object |
@@ -370,18 +370,18 @@ discard block |
||
| 370 | 370 | private function findFileWithExtension($class, $ext) |
| 371 | 371 | { |
| 372 | 372 | // PSR-4 lookup |
| 373 | - $logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext; |
|
| 373 | + $logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR).$ext; |
|
| 374 | 374 | |
| 375 | 375 | $first = $class[0]; |
| 376 | 376 | if (isset($this->prefixLengthsPsr4[$first])) { |
| 377 | 377 | $subPath = $class; |
| 378 | 378 | while (false !== $lastPos = strrpos($subPath, '\\')) { |
| 379 | 379 | $subPath = substr($subPath, 0, $lastPos); |
| 380 | - $search = $subPath . '\\'; |
|
| 380 | + $search = $subPath.'\\'; |
|
| 381 | 381 | if (isset($this->prefixDirsPsr4[$search])) { |
| 382 | - $pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1); |
|
| 382 | + $pathEnd = DIRECTORY_SEPARATOR.substr($logicalPathPsr4, $lastPos + 1); |
|
| 383 | 383 | foreach ($this->prefixDirsPsr4[$search] as $dir) { |
| 384 | - if (file_exists($file = $dir . $pathEnd)) { |
|
| 384 | + if (file_exists($file = $dir.$pathEnd)) { |
|
| 385 | 385 | return $file; |
| 386 | 386 | } |
| 387 | 387 | } |
@@ -391,7 +391,7 @@ discard block |
||
| 391 | 391 | |
| 392 | 392 | // PSR-4 fallback dirs |
| 393 | 393 | foreach ($this->fallbackDirsPsr4 as $dir) { |
| 394 | - if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) { |
|
| 394 | + if (file_exists($file = $dir.DIRECTORY_SEPARATOR.$logicalPathPsr4)) { |
|
| 395 | 395 | return $file; |
| 396 | 396 | } |
| 397 | 397 | } |
@@ -403,14 +403,14 @@ discard block |
||
| 403 | 403 | . strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR); |
| 404 | 404 | } else { |
| 405 | 405 | // PEAR-like class name |
| 406 | - $logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext; |
|
| 406 | + $logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR).$ext; |
|
| 407 | 407 | } |
| 408 | 408 | |
| 409 | 409 | if (isset($this->prefixesPsr0[$first])) { |
| 410 | 410 | foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) { |
| 411 | 411 | if (0 === strpos($class, $prefix)) { |
| 412 | 412 | foreach ($dirs as $dir) { |
| 413 | - if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { |
|
| 413 | + if (file_exists($file = $dir.DIRECTORY_SEPARATOR.$logicalPathPsr0)) { |
|
| 414 | 414 | return $file; |
| 415 | 415 | } |
| 416 | 416 | } |
@@ -420,7 +420,7 @@ discard block |
||
| 420 | 420 | |
| 421 | 421 | // PSR-0 fallback dirs |
| 422 | 422 | foreach ($this->fallbackDirsPsr0 as $dir) { |
| 423 | - if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { |
|
| 423 | + if (file_exists($file = $dir.DIRECTORY_SEPARATOR.$logicalPathPsr0)) { |
|
| 424 | 424 | return $file; |
| 425 | 425 | } |
| 426 | 426 | } |
@@ -370,18 +370,18 @@ discard block |
||
| 370 | 370 | private function findFileWithExtension($class, $ext) |
| 371 | 371 | { |
| 372 | 372 | // PSR-4 lookup |
| 373 | - $logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext; |
|
| 373 | + $logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR).$ext; |
|
| 374 | 374 | |
| 375 | 375 | $first = $class[0]; |
| 376 | 376 | if (isset($this->prefixLengthsPsr4[$first])) { |
| 377 | 377 | $subPath = $class; |
| 378 | 378 | while (false !== $lastPos = strrpos($subPath, '\\')) { |
| 379 | 379 | $subPath = substr($subPath, 0, $lastPos); |
| 380 | - $search = $subPath . '\\'; |
|
| 380 | + $search = $subPath.'\\'; |
|
| 381 | 381 | if (isset($this->prefixDirsPsr4[$search])) { |
| 382 | - $pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1); |
|
| 382 | + $pathEnd = DIRECTORY_SEPARATOR.substr($logicalPathPsr4, $lastPos + 1); |
|
| 383 | 383 | foreach ($this->prefixDirsPsr4[$search] as $dir) { |
| 384 | - if (file_exists($file = $dir . $pathEnd)) { |
|
| 384 | + if (file_exists($file = $dir.$pathEnd)) { |
|
| 385 | 385 | return $file; |
| 386 | 386 | } |
| 387 | 387 | } |
@@ -391,7 +391,7 @@ discard block |
||
| 391 | 391 | |
| 392 | 392 | // PSR-4 fallback dirs |
| 393 | 393 | foreach ($this->fallbackDirsPsr4 as $dir) { |
| 394 | - if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) { |
|
| 394 | + if (file_exists($file = $dir.DIRECTORY_SEPARATOR.$logicalPathPsr4)) { |
|
| 395 | 395 | return $file; |
| 396 | 396 | } |
| 397 | 397 | } |
@@ -403,14 +403,14 @@ discard block |
||
| 403 | 403 | . strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR); |
| 404 | 404 | } else { |
| 405 | 405 | // PEAR-like class name |
| 406 | - $logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext; |
|
| 406 | + $logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR).$ext; |
|
| 407 | 407 | } |
| 408 | 408 | |
| 409 | 409 | if (isset($this->prefixesPsr0[$first])) { |
| 410 | 410 | foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) { |
| 411 | 411 | if (0 === strpos($class, $prefix)) { |
| 412 | 412 | foreach ($dirs as $dir) { |
| 413 | - if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { |
|
| 413 | + if (file_exists($file = $dir.DIRECTORY_SEPARATOR.$logicalPathPsr0)) { |
|
| 414 | 414 | return $file; |
| 415 | 415 | } |
| 416 | 416 | } |
@@ -420,7 +420,7 @@ discard block |
||
| 420 | 420 | |
| 421 | 421 | // PSR-0 fallback dirs |
| 422 | 422 | foreach ($this->fallbackDirsPsr0 as $dir) { |
| 423 | - if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { |
|
| 423 | + if (file_exists($file = $dir.DIRECTORY_SEPARATOR.$logicalPathPsr0)) { |
|
| 424 | 424 | return $file; |
| 425 | 425 | } |
| 426 | 426 | } |
@@ -370,18 +370,18 @@ discard block |
||
| 370 | 370 | private function findFileWithExtension($class, $ext) |
| 371 | 371 | { |
| 372 | 372 | // PSR-4 lookup |
| 373 | - $logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext; |
|
| 373 | + $logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR).$ext; |
|
| 374 | 374 | |
| 375 | 375 | $first = $class[0]; |
| 376 | 376 | if (isset($this->prefixLengthsPsr4[$first])) { |
| 377 | 377 | $subPath = $class; |
| 378 | 378 | while (false !== $lastPos = strrpos($subPath, '\\')) { |
| 379 | 379 | $subPath = substr($subPath, 0, $lastPos); |
| 380 | - $search = $subPath . '\\'; |
|
| 380 | + $search = $subPath.'\\'; |
|
| 381 | 381 | if (isset($this->prefixDirsPsr4[$search])) { |
| 382 | - $pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1); |
|
| 382 | + $pathEnd = DIRECTORY_SEPARATOR.substr($logicalPathPsr4, $lastPos + 1); |
|
| 383 | 383 | foreach ($this->prefixDirsPsr4[$search] as $dir) { |
| 384 | - if (file_exists($file = $dir . $pathEnd)) { |
|
| 384 | + if (file_exists($file = $dir.$pathEnd)) { |
|
| 385 | 385 | return $file; |
| 386 | 386 | } |
| 387 | 387 | } |
@@ -391,7 +391,7 @@ discard block |
||
| 391 | 391 | |
| 392 | 392 | // PSR-4 fallback dirs |
| 393 | 393 | foreach ($this->fallbackDirsPsr4 as $dir) { |
| 394 | - if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) { |
|
| 394 | + if (file_exists($file = $dir.DIRECTORY_SEPARATOR.$logicalPathPsr4)) { |
|
| 395 | 395 | return $file; |
| 396 | 396 | } |
| 397 | 397 | } |
@@ -403,14 +403,14 @@ discard block |
||
| 403 | 403 | . strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR); |
| 404 | 404 | } else { |
| 405 | 405 | // PEAR-like class name |
| 406 | - $logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext; |
|
| 406 | + $logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR).$ext; |
|
| 407 | 407 | } |
| 408 | 408 | |
| 409 | 409 | if (isset($this->prefixesPsr0[$first])) { |
| 410 | 410 | foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) { |
| 411 | 411 | if (0 === strpos($class, $prefix)) { |
| 412 | 412 | foreach ($dirs as $dir) { |
| 413 | - if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { |
|
| 413 | + if (file_exists($file = $dir.DIRECTORY_SEPARATOR.$logicalPathPsr0)) { |
|
| 414 | 414 | return $file; |
| 415 | 415 | } |
| 416 | 416 | } |
@@ -420,7 +420,7 @@ discard block |
||
| 420 | 420 | |
| 421 | 421 | // PSR-0 fallback dirs |
| 422 | 422 | foreach ($this->fallbackDirsPsr0 as $dir) { |
| 423 | - if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { |
|
| 423 | + if (file_exists($file = $dir.DIRECTORY_SEPARATOR.$logicalPathPsr0)) { |
|
| 424 | 424 | return $file; |
| 425 | 425 | } |
| 426 | 426 | } |