Fix php-cs issues
Signed-off-by: Raimund Schlüßler <raimund.schluessler@mailbox.org>
This commit is contained in:
Родитель
2e776d4c6d
Коммит
007721b2eb
|
@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -29,7 +29,6 @@ use OCP\IRequest;
|
|||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class CollectionsControllerTest extends TestCase {
|
||||
|
||||
private $appName;
|
||||
private $collectionsService;
|
||||
private $request;
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -29,7 +29,6 @@ use OCP\IRequest;
|
|||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class SettingsControllerTest extends TestCase {
|
||||
|
||||
private $appName;
|
||||
private $settingsService;
|
||||
private $request;
|
||||
|
|
|
@ -29,7 +29,6 @@ use OCP\IL10N;
|
|||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class CollectionsServiceTest extends TestCase {
|
||||
|
||||
private $collectionsService;
|
||||
private $settings;
|
||||
private $userId;
|
||||
|
|
|
@ -28,7 +28,6 @@ use OCP\IConfig;
|
|||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class SettingsServiceTest extends TestCase {
|
||||
|
||||
private $settingsService;
|
||||
private $settings;
|
||||
private $userId;
|
||||
|
|
Загрузка…
Ссылка в новой задаче