Skip to content

Commit

Permalink
fixup! chore(settings): Cleanup IManager and Manager type annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
provokateurin committed Nov 22, 2023
1 parent 9444333 commit af0d627
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
12 changes: 6 additions & 6 deletions lib/private/Settings/Manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -249,13 +249,13 @@ public function getAdminSections(): array {

ksort($sections);

return array_values($sections);
return $sections;
}

/**
* @inheritdoc
*/
public function getAdminSettings($section, bool $subAdminOnly = false): array {
public function getAdminSettings(string $section, bool $subAdminOnly = false): array {
if ($subAdminOnly) {
$subAdminSettingsFilter = function (ISettings $settings) {
return $settings instanceof ISubAdminSettings;
Expand All @@ -274,7 +274,7 @@ public function getAdminSettings($section, bool $subAdminOnly = false): array {
}

ksort($settings);
return array_values($settings);
return $settings;
}

/**
Expand Down Expand Up @@ -306,7 +306,7 @@ public function getPersonalSections(): array {

ksort($sections);

return array_values($sections);
return $sections;
}

/**
Expand All @@ -326,7 +326,7 @@ private function hasLegacyPersonalSettingsToRender(array $forms): bool {
/**
* @inheritdoc
*/
public function getPersonalSettings($section): array {
public function getPersonalSettings(string $section): array {
$settings = [];
$appSettings = $this->getSettings('personal', $section);

Expand Down Expand Up @@ -372,7 +372,7 @@ public function getAllowedAdminSettings(string $section, IUser $user): array {
}

ksort($settings);
return array_values($settings);
return $settings;
}

/**
Expand Down
8 changes: 4 additions & 4 deletions lib/public/Settings/IManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,15 @@ public function registerSetting(string $type, string $setting);
/**
* returns a list of the admin sections
*
* @return list<array<int, IIconSection>> list of sections with priority as key
* @return array<int, list<IIconSection>> list of sections with priority as key
* @since 9.1.0
*/
public function getAdminSections(): array;

/**
* returns a list of the personal sections
*
* @return list<array<int, IIconSection>> list of sections with priority as key
* @return array<int, list<IIconSection>> list of sections with priority as key
* @since 13.0.0
*/
public function getPersonalSections(): array;
Expand All @@ -88,7 +88,7 @@ public function getPersonalSections(): array;
*
* @param string $section the section id for which to load the settings
* @param bool $subAdminOnly only return settings sub admins are supposed to see (since 17.0.0)
* @return list<array<int, ISettings>> list of settings with priority as key
* @return array<int, list<ISettings>> list of settings with priority as key
* @since 9.1.0
*/
public function getAdminSettings(string $section, bool $subAdminOnly = false): array;
Expand All @@ -113,7 +113,7 @@ public function getAllAllowedAdminSettings(IUser $user): array;
* returns a list of the personal settings
*
* @param string $section the section id for which to load the settings
* @return list<array<int, ISettings>> list of settings with priority as key
* @return array<int, list<ISettings>> list of settings with priority as key
* @since 13.0.0
*/
public function getPersonalSettings(string $section): array;
Expand Down

0 comments on commit af0d627

Please sign in to comment.