@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | $this |
50 | 50 | ->setIdentifier($invalidId) |
51 | 51 | ->setStorageClass('\OC\Files\Storage\FailedStorage') |
52 | - ->setText('Unknown storage backend ' . $invalidId); |
|
52 | + ->setText('Unknown storage backend '.$invalidId); |
|
53 | 53 | } |
54 | 54 | |
55 | 55 | /** |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | } |
63 | 63 | |
64 | 64 | public function manipulateStorageConfig(StorageConfig &$storage, IUser $user = null) { |
65 | - $storage->setBackendOption('exception', new \Exception('Unknown storage backend "' . $this->invalidId . '"', StorageNotAvailableException::STATUS_ERROR)); |
|
65 | + $storage->setBackendOption('exception', new \Exception('Unknown storage backend "'.$this->invalidId.'"', StorageNotAvailableException::STATUS_ERROR)); |
|
66 | 66 | } |
67 | 67 | } |
68 | 68 |
@@ -65,7 +65,7 @@ |
||
65 | 65 | $username_as_share = ($storage->getBackendOption('username_as_share') === true); |
66 | 66 | |
67 | 67 | if ($username_as_share) { |
68 | - $share = '/' . $storage->getBackendOption('user'); |
|
68 | + $share = '/'.$storage->getBackendOption('user'); |
|
69 | 69 | $storage->setBackendOption('share', $share); |
70 | 70 | } |
71 | 71 | } |
@@ -122,7 +122,7 @@ |
||
122 | 122 | } |
123 | 123 | |
124 | 124 | $eventName = $addToFavorite ? 'addFavorite' : 'removeFavorite'; |
125 | - $this->dispatcher->dispatch(self::class . '::' . $eventName, new GenericEvent(null, [ |
|
125 | + $this->dispatcher->dispatch(self::class.'::'.$eventName, new GenericEvent(null, [ |
|
126 | 126 | 'userId' => $user->getUID(), |
127 | 127 | 'fileId' => $fileId, |
128 | 128 | 'path' => $path, |
@@ -35,13 +35,13 @@ discard block |
||
35 | 35 | throw new \RuntimeException("No app with given id <$appId> known."); |
36 | 36 | } |
37 | 37 | |
38 | - if (!file_exists($appPath . '/appinfo/database.xml')) { |
|
38 | + if (!file_exists($appPath.'/appinfo/database.xml')) { |
|
39 | 39 | return ['errors' => [], 'warnings' => []]; |
40 | 40 | } |
41 | 41 | |
42 | 42 | libxml_use_internal_errors(true); |
43 | 43 | $loadEntities = libxml_disable_entity_loader(false); |
44 | - $xml = simplexml_load_file($appPath . '/appinfo/database.xml'); |
|
44 | + $xml = simplexml_load_file($appPath.'/appinfo/database.xml'); |
|
45 | 45 | libxml_disable_entity_loader($loadEntities); |
46 | 46 | |
47 | 47 | |
@@ -49,37 +49,37 @@ discard block |
||
49 | 49 | |
50 | 50 | foreach ($xml->table as $table) { |
51 | 51 | // Table names |
52 | - if (strpos((string)$table->name, '*dbprefix*') !== 0) { |
|
53 | - $errors[] = 'Database schema error: name of table ' . (string)$table->name . ' does not start with *dbprefix*'; |
|
52 | + if (strpos((string) $table->name, '*dbprefix*') !== 0) { |
|
53 | + $errors[] = 'Database schema error: name of table '.(string) $table->name.' does not start with *dbprefix*'; |
|
54 | 54 | } |
55 | - $tableName = substr((string)$table->name, strlen('*dbprefix*')); |
|
55 | + $tableName = substr((string) $table->name, strlen('*dbprefix*')); |
|
56 | 56 | if (strpos($tableName, '*dbprefix*') !== false) { |
57 | - $warnings[] = 'Database schema warning: *dbprefix* should only appear once in name of table ' . (string)$table->name; |
|
57 | + $warnings[] = 'Database schema warning: *dbprefix* should only appear once in name of table '.(string) $table->name; |
|
58 | 58 | } |
59 | 59 | |
60 | 60 | if (strlen($tableName) > 27) { |
61 | - $errors[] = 'Database schema error: Name of table ' . (string)$table->name . ' is too long (' . strlen($tableName) . '), max. 27 characters (21 characters for tables with autoincrement) + *dbprefix* allowed'; |
|
61 | + $errors[] = 'Database schema error: Name of table '.(string) $table->name.' is too long ('.strlen($tableName).'), max. 27 characters (21 characters for tables with autoincrement) + *dbprefix* allowed'; |
|
62 | 62 | } |
63 | 63 | |
64 | 64 | $hasAutoIncrement = false; |
65 | 65 | |
66 | 66 | // Column names |
67 | 67 | foreach ($table->declaration->field as $column) { |
68 | - if (strpos((string)$column->name, '*dbprefix*') !== false) { |
|
69 | - $warnings[] = 'Database schema warning: *dbprefix* should not appear in name of column ' . (string)$column->name . ' on table ' . (string)$table->name; |
|
68 | + if (strpos((string) $column->name, '*dbprefix*') !== false) { |
|
69 | + $warnings[] = 'Database schema warning: *dbprefix* should not appear in name of column '.(string) $column->name.' on table '.(string) $table->name; |
|
70 | 70 | } |
71 | 71 | |
72 | - if (strlen((string)$column->name) > 30) { |
|
73 | - $errors[] = 'Database schema error: Name of column ' . (string)$column->name . ' on table ' . (string)$table->name . ' is too long (' . strlen($tableName) . '), max. 30 characters allowed'; |
|
72 | + if (strlen((string) $column->name) > 30) { |
|
73 | + $errors[] = 'Database schema error: Name of column '.(string) $column->name.' on table '.(string) $table->name.' is too long ('.strlen($tableName).'), max. 30 characters allowed'; |
|
74 | 74 | } |
75 | 75 | |
76 | 76 | if ($column->autoincrement) { |
77 | 77 | if ($hasAutoIncrement) { |
78 | - $errors[] = 'Database schema error: Table ' . (string)$table->name . ' has multiple autoincrement columns'; |
|
78 | + $errors[] = 'Database schema error: Table '.(string) $table->name.' has multiple autoincrement columns'; |
|
79 | 79 | } |
80 | 80 | |
81 | 81 | if (strlen($tableName) > 21) { |
82 | - $errors[] = 'Database schema error: Name of table ' . (string)$table->name . ' is too long (' . strlen($tableName) . '), max. 27 characters (21 characters for tables with autoincrement) + *dbprefix* allowed'; |
|
82 | + $errors[] = 'Database schema error: Name of table '.(string) $table->name.' is too long ('.strlen($tableName).'), max. 27 characters (21 characters for tables with autoincrement) + *dbprefix* allowed'; |
|
83 | 83 | } |
84 | 84 | |
85 | 85 | $hasAutoIncrement = true; |
@@ -88,14 +88,14 @@ discard block |
||
88 | 88 | |
89 | 89 | // Index names |
90 | 90 | foreach ($table->declaration->index as $index) { |
91 | - $hasPrefix = strpos((string)$index->name, '*dbprefix*'); |
|
91 | + $hasPrefix = strpos((string) $index->name, '*dbprefix*'); |
|
92 | 92 | if ($hasPrefix !== false && $hasPrefix !== 0) { |
93 | - $warnings[] = 'Database schema warning: *dbprefix* should only appear at the beginning in name of index ' . (string)$index->name . ' on table ' . (string)$table->name; |
|
93 | + $warnings[] = 'Database schema warning: *dbprefix* should only appear at the beginning in name of index '.(string) $index->name.' on table '.(string) $table->name; |
|
94 | 94 | } |
95 | 95 | |
96 | - $indexName = $hasPrefix === 0 ? substr((string)$index->name, strlen('*dbprefix*')) : (string)$index->name; |
|
96 | + $indexName = $hasPrefix === 0 ? substr((string) $index->name, strlen('*dbprefix*')) : (string) $index->name; |
|
97 | 97 | if (strlen($indexName) > 27) { |
98 | - $errors[] = 'Database schema error: Name of index ' . (string)$index->name . ' on table ' . (string)$table->name . ' is too long (' . strlen($tableName) . '), max. 27 characters + *dbprefix* allowed'; |
|
98 | + $errors[] = 'Database schema error: Name of index '.(string) $index->name.' on table '.(string) $table->name.' is too long ('.strlen($tableName).'), max. 27 characters + *dbprefix* allowed'; |
|
99 | 99 | } |
100 | 100 | } |
101 | 101 | } |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | // WARNING: this should be moved to proper AppFramework handling |
24 | 24 | // Check if we are a user |
25 | 25 | if (!\OC::$server->getUserSession()->isLoggedIn()) { |
26 | - header('Location: ' . \OC::$server->getURLGenerator()->linkToRoute( |
|
26 | + header('Location: '.\OC::$server->getURLGenerator()->linkToRoute( |
|
27 | 27 | 'core.login.showLoginForm', |
28 | 28 | [ |
29 | 29 | 'redirect_url' => \OC::$server->getRequest()->getRequestUri(), |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | } |
35 | 35 | // Redirect to 2FA challenge selection if 2FA challenge was not solved yet |
36 | 36 | if (\OC::$server->getTwoFactorAuthManager()->needsSecondFactor(\OC::$server->getUserSession()->getUser())) { |
37 | - header('Location: ' . \OC::$server->getURLGenerator()->linkToRoute('core.TwoFactorChallenge.selectChallenge')); |
|
37 | + header('Location: '.\OC::$server->getURLGenerator()->linkToRoute('core.TwoFactorChallenge.selectChallenge')); |
|
38 | 38 | exit(); |
39 | 39 | } |
40 | 40 |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | * @return IMemcache |
134 | 134 | */ |
135 | 135 | public function createLocking(string $prefix = ''): IMemcache { |
136 | - return new $this->lockingCacheClass($this->globalPrefix . '/' . $prefix); |
|
136 | + return new $this->lockingCacheClass($this->globalPrefix.'/'.$prefix); |
|
137 | 137 | } |
138 | 138 | |
139 | 139 | /** |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | * @return ICache |
144 | 144 | */ |
145 | 145 | public function createDistributed(string $prefix = ''): ICache { |
146 | - return new $this->distributedCacheClass($this->globalPrefix . '/' . $prefix); |
|
146 | + return new $this->distributedCacheClass($this->globalPrefix.'/'.$prefix); |
|
147 | 147 | } |
148 | 148 | |
149 | 149 | /** |
@@ -153,7 +153,7 @@ discard block |
||
153 | 153 | * @return ICache |
154 | 154 | */ |
155 | 155 | public function createLocal(string $prefix = ''): ICache { |
156 | - return new $this->localCacheClass($this->globalPrefix . '/' . $prefix); |
|
156 | + return new $this->localCacheClass($this->globalPrefix.'/'.$prefix); |
|
157 | 157 | } |
158 | 158 | |
159 | 159 | /** |
@@ -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); |
@@ -36,7 +36,7 @@ |
||
36 | 36 | $timezones = \DateTimeZone::listIdentifiers(); |
37 | 37 | |
38 | 38 | if ($search !== '') { |
39 | - $timezones = array_filter($timezones, function ($timezone) use ($search) { |
|
39 | + $timezones = array_filter($timezones, function($timezone) use ($search) { |
|
40 | 40 | return stripos($timezone, $search) !== false; |
41 | 41 | }); |
42 | 42 | } |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | |
79 | 79 | $server->on('report', [$this, 'report']); |
80 | 80 | |
81 | - $server->xml->elementMap['{' . self::NS_Nextcloud . '}calendar-search'] = |
|
81 | + $server->xml->elementMap['{'.self::NS_Nextcloud.'}calendar-search'] = |
|
82 | 82 | CalendarSearchReport::class; |
83 | 83 | } |
84 | 84 | |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | */ |
93 | 93 | public function report($reportName, $report, $path) { |
94 | 94 | switch ($reportName) { |
95 | - case '{' . self::NS_Nextcloud . '}calendar-search': |
|
95 | + case '{'.self::NS_Nextcloud.'}calendar-search': |
|
96 | 96 | $this->server->transactionType = 'report-nc-calendar-search'; |
97 | 97 | $this->calendarSearch($report); |
98 | 98 | return false; |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | |
115 | 115 | $reports = []; |
116 | 116 | if ($node instanceof CalendarHome) { |
117 | - $reports[] = '{' . self::NS_Nextcloud . '}calendar-search'; |
|
117 | + $reports[] = '{'.self::NS_Nextcloud.'}calendar-search'; |
|
118 | 118 | } |
119 | 119 | |
120 | 120 | return $reports; |
@@ -144,7 +144,7 @@ discard block |
||
144 | 144 | |
145 | 145 | foreach ($nodePaths as $path) { |
146 | 146 | list($properties) = $this->server->getPropertiesForPath( |
147 | - $this->server->getRequestUri() . '/' . $path, |
|
147 | + $this->server->getRequestUri().'/'.$path, |
|
148 | 148 | $report->properties); |
149 | 149 | $result[] = $properties; |
150 | 150 | } |