@@ -273,6 +273,9 @@ discard block |
||
| 273 | 273 | return $this->mapper->has($table, 'section', $sectionId); |
| 274 | 274 | } |
| 275 | 275 | |
| 276 | + /** |
|
| 277 | + * @param string $type |
|
| 278 | + */ |
|
| 276 | 279 | private function setupSettingsEntry($settingsClassName, $type) { |
| 277 | 280 | if (!class_exists($settingsClassName)) { |
| 278 | 281 | $this->log->debug('Could not find ' . $type . ' section class ' . $settingsClassName); |
@@ -302,6 +305,9 @@ discard block |
||
| 302 | 305 | } |
| 303 | 306 | } |
| 304 | 307 | |
| 308 | + /** |
|
| 309 | + * @param string $type |
|
| 310 | + */ |
|
| 305 | 311 | private function getSectionTableForType($type) { |
| 306 | 312 | if($type === 'admin') { |
| 307 | 313 | return Mapper::TABLE_ADMIN_SECTIONS; |
@@ -188,7 +188,7 @@ discard block |
||
| 188 | 188 | */ |
| 189 | 189 | private function setupSectionEntry($sectionClassName, $type) { |
| 190 | 190 | if (!class_exists($sectionClassName)) { |
| 191 | - $this->log->debug('Could not find ' . ucfirst($type) . ' section class ' . $sectionClassName); |
|
| 191 | + $this->log->debug('Could not find '.ucfirst($type).' section class '.$sectionClassName); |
|
| 192 | 192 | return; |
| 193 | 193 | } |
| 194 | 194 | try { |
@@ -200,13 +200,13 @@ discard block |
||
| 200 | 200 | |
| 201 | 201 | if (!$section instanceof ISection) { |
| 202 | 202 | $this->log->error( |
| 203 | - ucfirst($type) .' section instance must implement \OCP\ISection. Invalid class: {class}', |
|
| 203 | + ucfirst($type).' section instance must implement \OCP\ISection. Invalid class: {class}', |
|
| 204 | 204 | ['class' => $sectionClassName] |
| 205 | 205 | ); |
| 206 | 206 | return; |
| 207 | 207 | } |
| 208 | 208 | $table = $this->getSectionTableForType($type); |
| 209 | - if(!$this->hasSection($section->getID(), $table)) { |
|
| 209 | + if (!$this->hasSection($section->getID(), $table)) { |
|
| 210 | 210 | $this->addSection($section, $table); |
| 211 | 211 | } else { |
| 212 | 212 | $this->updateSection($section, $table); |
@@ -275,7 +275,7 @@ discard block |
||
| 275 | 275 | |
| 276 | 276 | private function setupSettingsEntry($settingsClassName, $type) { |
| 277 | 277 | if (!class_exists($settingsClassName)) { |
| 278 | - $this->log->debug('Could not find ' . $type . ' section class ' . $settingsClassName); |
|
| 278 | + $this->log->debug('Could not find '.$type.' section class '.$settingsClassName); |
|
| 279 | 279 | return; |
| 280 | 280 | } |
| 281 | 281 | |
@@ -289,7 +289,7 @@ discard block |
||
| 289 | 289 | |
| 290 | 290 | if (!$settings instanceof ISettings) { |
| 291 | 291 | $this->log->error( |
| 292 | - ucfirst($type) . ' section instance must implement \OCP\Settings\ISettings. Invalid class: {class}', |
|
| 292 | + ucfirst($type).' section instance must implement \OCP\Settings\ISettings. Invalid class: {class}', |
|
| 293 | 293 | ['class' => $settingsClassName] |
| 294 | 294 | ); |
| 295 | 295 | return; |
@@ -303,18 +303,18 @@ discard block |
||
| 303 | 303 | } |
| 304 | 304 | |
| 305 | 305 | private function getSectionTableForType($type) { |
| 306 | - if($type === 'admin') { |
|
| 306 | + if ($type === 'admin') { |
|
| 307 | 307 | return Mapper::TABLE_ADMIN_SECTIONS; |
| 308 | - } else if($type === 'personal') { |
|
| 308 | + } else if ($type === 'personal') { |
|
| 309 | 309 | return Mapper::TABLE_PERSONAL_SECTIONS; |
| 310 | 310 | } |
| 311 | 311 | throw new \InvalidArgumentException('"admin" or "personal" expected'); |
| 312 | 312 | } |
| 313 | 313 | |
| 314 | 314 | private function getSettingsTableForType($type) { |
| 315 | - if($type === 'admin') { |
|
| 315 | + if ($type === 'admin') { |
|
| 316 | 316 | return Mapper::TABLE_ADMIN_SETTINGS; |
| 317 | - } else if($type === 'personal') { |
|
| 317 | + } else if ($type === 'personal') { |
|
| 318 | 318 | return Mapper::TABLE_PERSONAL_SETTINGS; |
| 319 | 319 | } |
| 320 | 320 | throw new \InvalidArgumentException('"admin" or "personal" expected'); |
@@ -421,7 +421,7 @@ discard block |
||
| 421 | 421 | ); |
| 422 | 422 | $forms[$form->getPriority()] = [$form]; |
| 423 | 423 | } |
| 424 | - if($section === 'security') { |
|
| 424 | + if ($section === 'security') { |
|
| 425 | 425 | /** @var ISettings $form */ |
| 426 | 426 | $form = new Personal\Security(); |
| 427 | 427 | $forms[$form->getPriority()] = [$form]; |
@@ -470,7 +470,7 @@ discard block |
||
| 470 | 470 | ]; |
| 471 | 471 | |
| 472 | 472 | $legacyForms = \OC_App::getForms('personal'); |
| 473 | - if(count($legacyForms) > 0 && $this->hasLegacyPersonalSettingsToRender($legacyForms)) { |
|
| 473 | + if (count($legacyForms) > 0 && $this->hasLegacyPersonalSettingsToRender($legacyForms)) { |
|
| 474 | 474 | $sections[98] = [new Section('additional', $this->l->t('Additional settings'), 0, $this->url->imagePath('core', 'actions/settings-dark.svg'))]; |
| 475 | 475 | } |
| 476 | 476 | |
@@ -498,7 +498,7 @@ discard block |
||
| 498 | 498 | */ |
| 499 | 499 | private function hasLegacyPersonalSettingsToRender($forms) { |
| 500 | 500 | foreach ($forms as $form) { |
| 501 | - if(trim($form) !== '') { |
|
| 501 | + if (trim($form) !== '') { |
|
| 502 | 502 | return true; |
| 503 | 503 | } |
| 504 | 504 | } |