From 13f7e635144a5081174218dfca720922b337d05c Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Wed, 3 Feb 2021 10:15:59 +0100 Subject: [PATCH] PSR 2 compliance --- lib/Controller/NavController.php | 3 ++- lib/Controller/PersonalSettingController.php | 4 ++-- lib/Service/CategoryRepository.php | 10 ++++------ lib/Settings/AdminSection.php | 12 ++++-------- lib/Settings/PersonalSection.php | 12 ++++-------- 5 files changed, 16 insertions(+), 25 deletions(-) diff --git a/lib/Controller/NavController.php b/lib/Controller/NavController.php index 2c80673..4f6625e 100644 --- a/lib/Controller/NavController.php +++ b/lib/Controller/NavController.php @@ -189,7 +189,8 @@ class NavController extends Controller foreach ($categoriesLabels as $key => $value) { if ($a['categoryId'] === $key) { return -1; - } elseif ($b['categoryId'] === $key) { + } + if ($b['categoryId'] === $key) { return 1; } } diff --git a/lib/Controller/PersonalSettingController.php b/lib/Controller/PersonalSettingController.php index e4d47b0..99bc65a 100644 --- a/lib/Controller/PersonalSettingController.php +++ b/lib/Controller/PersonalSettingController.php @@ -18,13 +18,13 @@ namespace OCA\SideMenu\Controller; +use OCA\SideMenu\AppInfo\Application; +use OCA\SideMenu\Service\ConfigProxy; use OCP\AppFramework\Controller; use OCP\AppFramework\Http\Response; use OCP\IConfig; use OCP\IRequest; use OCP\IUserSession; -use OCA\SideMenu\AppInfo\Application; -use OCA\SideMenu\Service\ConfigProxy; class PersonalSettingController extends Controller { diff --git a/lib/Service/CategoryRepository.php b/lib/Service/CategoryRepository.php index b39628f..e523cd7 100644 --- a/lib/Service/CategoryRepository.php +++ b/lib/Service/CategoryRepository.php @@ -3,10 +3,9 @@ namespace OCA\SideMenu\Service; use OC\App\AppStore\Fetcher\CategoryFetcher; +use OCA\SideMenu\AppInfo\Application; use OCP\IConfig; use OCP\L10N\IFactory; -use OCA\SideMenu\Service\ConfigProxy; -use OCA\SideMenu\AppInfo\Application; /** * class CategoryRepository. @@ -36,12 +35,11 @@ class CategoryRepository protected $iConfig; public function __construct( - CategoryFetcher $categoryFetcher, - ConfigProxy $config, + CategoryFetcher $categoryFetcher, + ConfigProxy $config, IConfig $iConfig, IFactory $l10nFactory - ) - { + ) { $this->categoryFetcher = $categoryFetcher; $this->l10nFactory = $l10nFactory; $this->config = $config; diff --git a/lib/Settings/AdminSection.php b/lib/Settings/AdminSection.php index 7135d68..8629e8a 100644 --- a/lib/Settings/AdminSection.php +++ b/lib/Settings/AdminSection.php @@ -18,10 +18,10 @@ namespace OCA\SideMenu\Settings; +use OCA\SideMenu\AppInfo\Application; use OCP\IL10N; use OCP\IURLGenerator; use OCP\Settings\IIconSection; -use OCA\SideMenu\AppInfo\Application; class AdminSection implements IIconSection { @@ -35,10 +35,6 @@ class AdminSection implements IIconSection */ private $url; - /** - * @param IURLGenerator $url - * @param IL10N $l - */ public function __construct(IURLGenerator $url, IL10N $l) { $this->url = $url; @@ -47,7 +43,7 @@ class AdminSection implements IIconSection /** * returns the ID of the section. It is supposed to be a lower case string, - * e.g. 'ldap' + * e.g. 'ldap'. * * @returns string */ @@ -69,8 +65,8 @@ class AdminSection implements IIconSection /** * @return int whether the form should be rather on the top or bottom of - * the settings navigation. The sections are arranged in ascending order of - * the priority values. It is required to return a value between 0 and 99. + * the settings navigation. The sections are arranged in ascending order of + * the priority values. It is required to return a value between 0 and 99. * * E.g.: 70 */ diff --git a/lib/Settings/PersonalSection.php b/lib/Settings/PersonalSection.php index 77ec5a9..101d95f 100644 --- a/lib/Settings/PersonalSection.php +++ b/lib/Settings/PersonalSection.php @@ -18,10 +18,10 @@ namespace OCA\SideMenu\Settings; +use OCA\SideMenu\AppInfo\Application; use OCP\IL10N; use OCP\IURLGenerator; use OCP\Settings\IIconSection; -use OCA\SideMenu\AppInfo\Application; class PersonalSection implements IIconSection { @@ -35,10 +35,6 @@ class PersonalSection implements IIconSection */ private $url; - /** - * @param IURLGenerator $url - * @param IL10N $l - */ public function __construct(IURLGenerator $url, IL10N $l) { $this->url = $url; @@ -47,7 +43,7 @@ class PersonalSection implements IIconSection /** * returns the ID of the section. It is supposed to be a lower case string, - * e.g. 'ldap' + * e.g. 'ldap'. * * @returns string */ @@ -69,8 +65,8 @@ class PersonalSection implements IIconSection /** * @return int whether the form should be rather on the top or bottom of - * the settings navigation. The sections are arranged in ascending order of - * the priority values. It is required to return a value between 0 and 99. + * the settings navigation. The sections are arranged in ascending order of + * the priority values. It is required to return a value between 0 and 99. * * E.g.: 70 */