summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2020-10-28 22:51:49 +0100
committerMorris Jobke <hey@morrisjobke.de>2020-10-28 23:05:00 +0100
commitb8ed99723822d23c9a3a0b413eb237c93fc60c99 (patch)
treea3e2136a5faa0ac5bca63d3d2f6936272edbd0db /apps
parentef382f541c42f719b8dd30a4e0e248ef1bc39c84 (diff)
downloadnextcloud-server-b8ed99723822d23c9a3a0b413eb237c93fc60c99.tar.gz
nextcloud-server-b8ed99723822d23c9a3a0b413eb237c93fc60c99.zip
Remove ISection in favor of IIconSection
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Diffstat (limited to 'apps')
-rw-r--r--apps/settings/lib/Controller/CommonSettingsTrait.php8
-rw-r--r--apps/settings/lib/Search/SectionSearch.php7
-rw-r--r--apps/theming/tests/ServicesTest.php4
3 files changed, 6 insertions, 13 deletions
diff --git a/apps/settings/lib/Controller/CommonSettingsTrait.php b/apps/settings/lib/Controller/CommonSettingsTrait.php
index 20e0ef4a24f..4ad3d7497e9 100644
--- a/apps/settings/lib/Controller/CommonSettingsTrait.php
+++ b/apps/settings/lib/Controller/CommonSettingsTrait.php
@@ -34,7 +34,6 @@ use OCP\IGroupManager;
use OCP\INavigationManager;
use OCP\IUser;
use OCP\IUserSession;
-use OCP\Settings\IIconSection;
use OCP\Settings\IManager as ISettingsManager;
use OCP\Settings\ISettings;
@@ -84,7 +83,7 @@ trait CommonSettingsTrait {
protected function formatSections($sections, $currentSection, $type, $currentType, bool $subAdminOnly = false) {
$templateParameters = [];
- /** @var \OCP\Settings\ISection[] $prioritizedSections */
+ /** @var \OCP\Settings\IIconSection[] $prioritizedSections */
foreach ($sections as $prioritizedSections) {
foreach ($prioritizedSections as $section) {
if ($type === 'admin') {
@@ -96,10 +95,7 @@ trait CommonSettingsTrait {
continue;
}
- $icon = '';
- if ($section instanceof IIconSection) {
- $icon = $section->getIcon();
- }
+ $icon = $section->getIcon();
$active = $section->getID() === $currentSection
&& $type === $currentType;
diff --git a/apps/settings/lib/Search/SectionSearch.php b/apps/settings/lib/Search/SectionSearch.php
index 67dc0f5d156..e9cd9615db7 100644
--- a/apps/settings/lib/Search/SectionSearch.php
+++ b/apps/settings/lib/Search/SectionSearch.php
@@ -35,7 +35,7 @@ use OCP\Search\IProvider;
use OCP\Search\ISearchQuery;
use OCP\Search\SearchResult;
use OCP\Search\SearchResultEntry;
-use OCP\Settings\ISection;
+use OCP\Settings\IIconSection;
use OCP\Settings\IManager;
class SectionSearch implements IProvider {
@@ -117,7 +117,7 @@ class SectionSearch implements IProvider {
/**
* @param ISearchQuery $query
- * @param ISection[][] $sections
+ * @param IIconSection[][] $sections
* @param string $subline
* @param string $routeName
* @return array
@@ -135,10 +135,7 @@ class SectionSearch implements IProvider {
/**
* We can't use the icon URL at the moment as they don't invert correctly for dark theme
- * $iconUrl = '';
- * if ($section instanceof IIconSection) {
* $iconUrl = $section->getIcon();
- * }
*/
$result[] = new SearchResultEntry(
diff --git a/apps/theming/tests/ServicesTest.php b/apps/theming/tests/ServicesTest.php
index ce893c8cccb..2705c7a4ece 100644
--- a/apps/theming/tests/ServicesTest.php
+++ b/apps/theming/tests/ServicesTest.php
@@ -34,7 +34,7 @@ use OCA\Theming\Util;
use OCP\AppFramework\App;
use OCP\Capabilities\ICapability;
use OCP\IL10N;
-use OCP\Settings\ISection;
+use OCP\Settings\IIconSection;
use OCP\Settings\ISettings;
use Test\TestCase;
@@ -75,7 +75,7 @@ class ServicesTest extends TestCase {
[Admin::class],
[Admin::class, ISettings::class],
[Section::class],
- [Section::class, ISection::class],
+ [Section::class, IIconSection::class],
];
}