@@ -126,12 +126,12 @@ |
||
| 126 | 126 | $hosts = $this->configService->getElasticHost(); |
| 127 | 127 | foreach ($hosts as $host) { |
| 128 | 128 | $parsedHost = parse_url($host); |
| 129 | - $safeHost = $parsedHost['scheme'] . '://'; |
|
| 129 | + $safeHost = $parsedHost['scheme'].'://'; |
|
| 130 | 130 | if (array_key_exists('user', $parsedHost)) { |
| 131 | - $safeHost .= $parsedHost['user'] . ':' . '********' . '@'; |
|
| 131 | + $safeHost .= $parsedHost['user'].':'.'********'.'@'; |
|
| 132 | 132 | } |
| 133 | 133 | $safeHost .= $parsedHost['host']; |
| 134 | - $safeHost .= ':' . $parsedHost['port']; |
|
| 134 | + $safeHost .= ':'.$parsedHost['port']; |
|
| 135 | 135 | |
| 136 | 136 | $sanitizedHosts[] = $safeHost; |
| 137 | 137 | } |
@@ -404,7 +404,7 @@ discard block |
||
| 404 | 404 | foreach ($keys as $key) { |
| 405 | 405 | if (!array_key_exists($key, $arr)) { |
| 406 | 406 | throw new MalformedArrayException( |
| 407 | - 'source: ' . json_encode($arr) . ' - missing key: ' . $key |
|
| 407 | + 'source: '.json_encode($arr).' - missing key: '.$key |
|
| 408 | 408 | ); |
| 409 | 409 | } |
| 410 | 410 | } |
@@ -417,7 +417,7 @@ discard block |
||
| 417 | 417 | protected function cleanArray(array &$arr) { |
| 418 | 418 | $arr = array_filter( |
| 419 | 419 | $arr, |
| 420 | - function ($v) { |
|
| 420 | + function($v) { |
|
| 421 | 421 | if (is_string($v)) { |
| 422 | 422 | return ($v !== ''); |
| 423 | 423 | } |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | 'index' => |
| 68 | 68 | [ |
| 69 | 69 | 'index' => $this->configService->getElasticIndex(), |
| 70 | - 'id' => $document->getProviderId() . ':' . $document->getId(), |
|
| 70 | + 'id' => $document->getProviderId().':'.$document->getId(), |
|
| 71 | 71 | 'body' => $this->generateIndexBody($document) |
| 72 | 72 | ] |
| 73 | 73 | ]; |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | 'index' => |
| 96 | 96 | [ |
| 97 | 97 | 'index' => $this->configService->getElasticIndex(), |
| 98 | - 'id' => $document->getProviderId() . ':' . $document->getId(), |
|
| 98 | + 'id' => $document->getProviderId().':'.$document->getId(), |
|
| 99 | 99 | 'body' => ['doc' => $this->generateIndexBody($document)] |
| 100 | 100 | ] |
| 101 | 101 | ]; |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | 'index' => |
| 126 | 126 | [ |
| 127 | 127 | 'index' => $this->configService->getElasticIndex(), |
| 128 | - 'id' => $providerId . ':' . $documentId, |
|
| 128 | + 'id' => $providerId.':'.$documentId, |
|
| 129 | 129 | ] |
| 130 | 130 | ]; |
| 131 | 131 | |
@@ -34,7 +34,7 @@ |
||
| 34 | 34 | use OCP\AppFramework\Bootstrap\IBootstrap; |
| 35 | 35 | use OCP\AppFramework\Bootstrap\IRegistrationContext; |
| 36 | 36 | |
| 37 | -require_once __DIR__ . '/../../vendor/autoload.php'; |
|
| 37 | +require_once __DIR__.'/../../vendor/autoload.php'; |
|
| 38 | 38 | |
| 39 | 39 | class Application extends App implements IBootstrap { |
| 40 | 40 | |
@@ -48,8 +48,7 @@ discard block |
||
| 48 | 48 | */ |
| 49 | 49 | class SearchMappingService { |
| 50 | 50 | |
| 51 | - public function __construct |
|
| 52 | - ( |
|
| 51 | + public function __construct( |
|
| 53 | 52 | private ConfigService $configService |
| 54 | 53 | ) { |
| 55 | 54 | } |
@@ -275,7 +274,7 @@ discard block |
||
| 275 | 274 | |
| 276 | 275 | foreach ($request->getWildcardFields() as $field) { |
| 277 | 276 | if (!$this->fieldIsOutLimit($request, $field)) { |
| 278 | - $queryFields[] = ['wildcard' => [$field => '*' . $content->getWord() . '*']]; |
|
| 277 | + $queryFields[] = ['wildcard' => [$field => '*'.$content->getWord().'*']]; |
|
| 279 | 278 | } |
| 280 | 279 | } |
| 281 | 280 | |
@@ -439,7 +438,7 @@ discard block |
||
| 439 | 438 | public function getDocumentQuery(string $providerId, string $documentId): array { |
| 440 | 439 | return [ |
| 441 | 440 | 'index' => $this->configService->getElasticIndex(), |
| 442 | - 'id' => $providerId . ':' . $documentId |
|
| 441 | + 'id' => $providerId.':'.$documentId |
|
| 443 | 442 | ]; |
| 444 | 443 | } |
| 445 | 444 | |
@@ -451,8 +450,8 @@ discard block |
||
| 451 | 450 | */ |
| 452 | 451 | private function getPartsFields(ISearchRequest $request): array { |
| 453 | 452 | return array_map( |
| 454 | - function (string $value): string { |
|
| 455 | - return 'parts.' . $value; |
|
| 453 | + function(string $value): string { |
|
| 454 | + return 'parts.'.$value; |
|
| 456 | 455 | }, $request->getParts() |
| 457 | 456 | ); |
| 458 | 457 | } |
@@ -145,7 +145,7 @@ |
||
| 145 | 145 | } |
| 146 | 146 | |
| 147 | 147 | return $this->config->getSystemValueString( |
| 148 | - Application::APP_NAME . '.' . $key, |
|
| 148 | + Application::APP_NAME.'.'.$key, |
|
| 149 | 149 | (string)$this->config->getAppValue(Application::APP_NAME, $key, $defaultValue) |
| 150 | 150 | ); |
| 151 | 151 | } |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | if (is_string($record)) { |
| 89 | 89 | $record = ['message' => $record]; |
| 90 | 90 | } |
| 91 | - return $this->hasRecordThatPasses(function ($rec) use ($record) { |
|
| 91 | + return $this->hasRecordThatPasses(function($rec) use ($record) { |
|
| 92 | 92 | if ($rec['message'] !== $record['message']) { |
| 93 | 93 | return false; |
| 94 | 94 | } |
@@ -101,14 +101,14 @@ discard block |
||
| 101 | 101 | |
| 102 | 102 | public function hasRecordThatContains($message, $level) |
| 103 | 103 | { |
| 104 | - return $this->hasRecordThatPasses(function ($rec) use ($message) { |
|
| 104 | + return $this->hasRecordThatPasses(function($rec) use ($message) { |
|
| 105 | 105 | return strpos($rec['message'], $message) !== false; |
| 106 | 106 | }, $level); |
| 107 | 107 | } |
| 108 | 108 | |
| 109 | 109 | public function hasRecordThatMatches($regex, $level) |
| 110 | 110 | { |
| 111 | - return $this->hasRecordThatPasses(function ($rec) use ($regex) { |
|
| 111 | + return $this->hasRecordThatPasses(function($rec) use ($regex) { |
|
| 112 | 112 | return preg_match($regex, $rec['message']) > 0; |
| 113 | 113 | }, $level); |
| 114 | 114 | } |
@@ -129,14 +129,14 @@ discard block |
||
| 129 | 129 | public function __call($method, $args) |
| 130 | 130 | { |
| 131 | 131 | if (preg_match('/(.*)(Debug|Info|Notice|Warning|Error|Critical|Alert|Emergency)(.*)/', $method, $matches) > 0) { |
| 132 | - $genericMethod = $matches[1] . ('Records' !== $matches[3] ? 'Record' : '') . $matches[3]; |
|
| 132 | + $genericMethod = $matches[1].('Records' !== $matches[3] ? 'Record' : '').$matches[3]; |
|
| 133 | 133 | $level = strtolower($matches[2]); |
| 134 | 134 | if (method_exists($this, $genericMethod)) { |
| 135 | 135 | $args[] = $level; |
| 136 | 136 | return call_user_func_array([$this, $genericMethod], $args); |
| 137 | 137 | } |
| 138 | 138 | } |
| 139 | - throw new \BadMethodCallException('Call to undefined method ' . get_class($this) . '::' . $method . '()'); |
|
| 139 | + throw new \BadMethodCallException('Call to undefined method '.get_class($this).'::'.$method.'()'); |
|
| 140 | 140 | } |
| 141 | 141 | |
| 142 | 142 | public function reset() |
@@ -191,7 +191,7 @@ discard block |
||
| 191 | 191 | $event->stopPropagation(); |
| 192 | 192 | |
| 193 | 193 | $dispatcher = $composer->getEventDispatcher(); |
| 194 | - $disableScripts = !method_exists($dispatcher, 'setRunScripts') || !((array) $dispatcher)["\0*\0runScripts"]; |
|
| 194 | + $disableScripts = !method_exists($dispatcher, 'setRunScripts') || !((array)$dispatcher)["\0*\0runScripts"]; |
|
| 195 | 195 | $composer = Factory::create($event->getIO(), null, false, $disableScripts); |
| 196 | 196 | |
| 197 | 197 | /** @var Installer $installer */ |
@@ -212,7 +212,7 @@ discard block |
||
| 212 | 212 | $composer->getAutoloadGenerator() |
| 213 | 213 | ); |
| 214 | 214 | if (method_exists($installer, 'setPlatformRequirementFilter')) { |
| 215 | - $installer->setPlatformRequirementFilter(((array) $trace['object'])["\0*\0platformRequirementFilter"]); |
|
| 215 | + $installer->setPlatformRequirementFilter(((array)$trace['object'])["\0*\0platformRequirementFilter"]); |
|
| 216 | 216 | } |
| 217 | 217 | |
| 218 | 218 | if (0 !== $installer->run()) { |
@@ -263,7 +263,7 @@ discard block |
||
| 263 | 263 | } |
| 264 | 264 | |
| 265 | 265 | if (isset($package->getRequires()['php-http/discovery'])) { |
| 266 | - $requires[(int) isset($devPackages[$package->getName()])] += $package->getRequires(); |
|
| 266 | + $requires[(int)isset($devPackages[$package->getName()])] += $package->getRequires(); |
|
| 267 | 267 | } |
| 268 | 268 | } |
| 269 | 269 | |
@@ -188,7 +188,7 @@ |
||
| 188 | 188 | return self::safeClassExists($condition); |
| 189 | 189 | } |
| 190 | 190 | if (is_callable($condition)) { |
| 191 | - return (bool) $condition(); |
|
| 191 | + return (bool)$condition(); |
|
| 192 | 192 | } |
| 193 | 193 | if (is_bool($condition)) { |
| 194 | 194 | return $condition; |