From 007721b2eb68113694fea7ea6f747e9e0285154e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Raimund=20Schl=C3=BC=C3=9Fler?= Date: Wed, 15 Apr 2020 09:33:27 +0200 Subject: [PATCH] Fix php-cs issues MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Raimund Schlüßler --- lib/Controller/Response.php | 5 +---- lib/Service/CollectionsService.php | 4 ++-- tests/php/integration/AppInfo/ApplicationTest.php | 2 -- tests/php/unit/Controller/CollectionsControllerTest.php | 1 - tests/php/unit/Controller/PageControllerTest.php | 1 - tests/php/unit/Controller/SettingsControllerTest.php | 1 - tests/php/unit/Service/CollectionsServiceTest.php | 1 - tests/php/unit/Service/SettingsServiceTest.php | 1 - 8 files changed, 3 insertions(+), 13 deletions(-) diff --git a/lib/Controller/Response.php b/lib/Controller/Response.php index 9dac6506..5790a6fd 100644 --- a/lib/Controller/Response.php +++ b/lib/Controller/Response.php @@ -26,7 +26,6 @@ use \Closure; use \OCP\AppFramework\Http\JSONResponse; trait Response { - protected function generateResponse(Closure $callback) { try { $message = [ @@ -34,8 +33,7 @@ trait Response { 'data' => $callback(), 'message' => null ]; - - } catch(\Exception $e) { + } catch (\Exception $e) { $message = [ 'status' => 'error', 'data' => null, @@ -44,5 +42,4 @@ trait Response { } return new JSONResponse($message); } - } diff --git a/lib/Service/CollectionsService.php b/lib/Service/CollectionsService.php index c8a91053..5b7d266c 100644 --- a/lib/Service/CollectionsService.php +++ b/lib/Service/CollectionsService.php @@ -98,7 +98,7 @@ class CollectionsService { 'show' => 2, 'icon' => 'sprt-checkmark'] ]; - foreach ($collections as $key => $collection){ + foreach ($collections as $key => $collection) { $tmp = $this->settings->getUserValue($this->userId, $this->appName,'show_'.$collection['id']); if (!in_array($tmp, ['0','1','2'])) { $this->settings->setUserValue($this->userId, $this->appName,'show_'.$collection['id'],$collections[$key]['show']); @@ -117,7 +117,7 @@ class CollectionsService { * @return bool */ public function setVisibility(string $collectionID, int $visibility):bool { - if (in_array($visibility, [0,1,2])){ + if (in_array($visibility, [0,1,2])) { $this->settings->setUserValue($this->userId, $this->appName,'show_'.$collectionID,$visibility); } return true; diff --git a/tests/php/integration/AppInfo/ApplicationTest.php b/tests/php/integration/AppInfo/ApplicationTest.php index a78fb33b..8399abd2 100644 --- a/tests/php/integration/AppInfo/ApplicationTest.php +++ b/tests/php/integration/AppInfo/ApplicationTest.php @@ -26,7 +26,6 @@ use PHPUnit\Framework\TestCase; class AppTest extends TestCase { - private $container; private $app; @@ -47,5 +46,4 @@ class AppTest extends TestCase { $enabled = array_key_exists('tasks', $navigationManager->getAll()); $this->assertTrue($enabled); } - } diff --git a/tests/php/unit/Controller/CollectionsControllerTest.php b/tests/php/unit/Controller/CollectionsControllerTest.php index bfcdde70..61f8a8d6 100644 --- a/tests/php/unit/Controller/CollectionsControllerTest.php +++ b/tests/php/unit/Controller/CollectionsControllerTest.php @@ -29,7 +29,6 @@ use OCP\IRequest; use PHPUnit\Framework\TestCase; class CollectionsControllerTest extends TestCase { - private $appName; private $collectionsService; private $request; diff --git a/tests/php/unit/Controller/PageControllerTest.php b/tests/php/unit/Controller/PageControllerTest.php index a6dba9fe..3f61de9a 100644 --- a/tests/php/unit/Controller/PageControllerTest.php +++ b/tests/php/unit/Controller/PageControllerTest.php @@ -15,7 +15,6 @@ use OCP\AppFramework\Http\TemplateResponse; use PHPUnit\Framework\TestCase as Base; class PageControllerTest extends Base { - private $controller; public function setUp(): void { diff --git a/tests/php/unit/Controller/SettingsControllerTest.php b/tests/php/unit/Controller/SettingsControllerTest.php index 7e9c99c8..26d19548 100644 --- a/tests/php/unit/Controller/SettingsControllerTest.php +++ b/tests/php/unit/Controller/SettingsControllerTest.php @@ -29,7 +29,6 @@ use OCP\IRequest; use PHPUnit\Framework\TestCase; class SettingsControllerTest extends TestCase { - private $appName; private $settingsService; private $request; diff --git a/tests/php/unit/Service/CollectionsServiceTest.php b/tests/php/unit/Service/CollectionsServiceTest.php index eef7ef6c..2a58d6c6 100644 --- a/tests/php/unit/Service/CollectionsServiceTest.php +++ b/tests/php/unit/Service/CollectionsServiceTest.php @@ -29,7 +29,6 @@ use OCP\IL10N; use PHPUnit\Framework\TestCase; class CollectionsServiceTest extends TestCase { - private $collectionsService; private $settings; private $userId; diff --git a/tests/php/unit/Service/SettingsServiceTest.php b/tests/php/unit/Service/SettingsServiceTest.php index 36ffa5f6..36a73a7f 100644 --- a/tests/php/unit/Service/SettingsServiceTest.php +++ b/tests/php/unit/Service/SettingsServiceTest.php @@ -28,7 +28,6 @@ use OCP\IConfig; use PHPUnit\Framework\TestCase; class SettingsServiceTest extends TestCase { - private $settingsService; private $settings; private $userId;