@@ -56,8 +56,7 @@ |
||
56 | 56 | use OCP\IL10N; |
57 | 57 | use OCP\IRequest; |
58 | 58 | |
59 | -class PicoController extends Controller |
|
60 | -{ |
|
59 | +class PicoController extends Controller { |
|
61 | 60 | /** @var string|null */ |
62 | 61 | private $userId; |
63 | 62 |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | */ |
109 | 109 | public function getPersonalWebsites(): DataResponse |
110 | 110 | { |
111 | - $data = [ 'websites' => $this->websitesService->getWebsitesFromUser($this->userId) ]; |
|
111 | + $data = ['websites' => $this->websitesService->getWebsitesFromUser($this->userId)]; |
|
112 | 112 | return new DataResponse($data, Http::STATUS_OK); |
113 | 113 | } |
114 | 114 | |
@@ -136,13 +136,13 @@ discard block |
||
136 | 136 | } catch (\Exception $e) { |
137 | 137 | $data = []; |
138 | 138 | if ($e instanceof WebsiteExistsException) { |
139 | - $data['form_error'] = [ 'field' => 'site', 'message' => $this->l10n->t('Website exists.') ]; |
|
139 | + $data['form_error'] = ['field' => 'site', 'message' => $this->l10n->t('Website exists.')]; |
|
140 | 140 | } elseif (($e instanceof WebsiteInvalidDataException) && $e->getField()) { |
141 | - $data['form_error'] = [ 'field' => $e->getField(), 'message' => $e->getMessage() ]; |
|
141 | + $data['form_error'] = ['field' => $e->getField(), 'message' => $e->getMessage()]; |
|
142 | 142 | } elseif ($e instanceof ThemeNotFoundException) { |
143 | - $data['form_error'] = [ 'field' => 'theme', 'message' => $this->l10n->t('Theme not found.') ]; |
|
143 | + $data['form_error'] = ['field' => 'theme', 'message' => $this->l10n->t('Theme not found.')]; |
|
144 | 144 | } elseif ($e instanceof TemplateNotFoundException) { |
145 | - $data['form_error'] = [ 'field' => 'template', 'message' => $this->l10n->t('Template not found.') ]; |
|
145 | + $data['form_error'] = ['field' => 'template', 'message' => $this->l10n->t('Template not found.')]; |
|
146 | 146 | } |
147 | 147 | |
148 | 148 | return $this->createErrorResponse($e, $data); |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | foreach ($data as $key => $value) { |
168 | 168 | switch ($key) { |
169 | 169 | case 'type': |
170 | - $website->setType((int) $value); |
|
170 | + $website->setType((int)$value); |
|
171 | 171 | break; |
172 | 172 | |
173 | 173 | case 'theme': |
@@ -185,13 +185,13 @@ discard block |
||
185 | 185 | } catch (\Exception $e) { |
186 | 186 | $data = []; |
187 | 187 | if (($e instanceof WebsiteNotFoundException) || ($e instanceof WebsiteForeignOwnerException)) { |
188 | - $data['form_error'] = [ 'field' => 'identifier', 'message' => $this->l10n->t('Website not found.') ]; |
|
188 | + $data['form_error'] = ['field' => 'identifier', 'message' => $this->l10n->t('Website not found.')]; |
|
189 | 189 | } elseif ($e instanceof WebsiteInvalidDataException) { |
190 | - $data['form_error'] = [ 'field' => $e->getField(), 'message' => $e->getMessage() ]; |
|
190 | + $data['form_error'] = ['field' => $e->getField(), 'message' => $e->getMessage()]; |
|
191 | 191 | } elseif ($e instanceof ThemeNotFoundException) { |
192 | - $data['form_error'] = [ 'field' => 'theme', 'message' => $this->l10n->t('Theme not found.') ]; |
|
192 | + $data['form_error'] = ['field' => 'theme', 'message' => $this->l10n->t('Theme not found.')]; |
|
193 | 193 | } elseif ($e instanceof TemplateNotFoundException) { |
194 | - $data['form_error'] = [ 'field' => 'template', 'message' => $this->l10n->t('Template not found.') ]; |
|
194 | + $data['form_error'] = ['field' => 'template', 'message' => $this->l10n->t('Template not found.')]; |
|
195 | 195 | } |
196 | 196 | |
197 | 197 | return $this->createErrorResponse($e, $data); |
@@ -368,7 +368,7 @@ discard block |
||
368 | 368 | */ |
369 | 369 | private function createErrorResponse(\Exception $exception, array $data = []): DataResponse |
370 | 370 | { |
371 | - $this->logger->logException($exception, [ 'app' => Application::APP_NAME, 'level' => 2 ]); |
|
371 | + $this->logger->logException($exception, ['app' => Application::APP_NAME, 'level' => 2]); |
|
372 | 372 | |
373 | 373 | $data['status'] = 0; |
374 | 374 | if (\OC::$server->getSystemConfig()->getValue('debug', false)) { |
@@ -45,8 +45,7 @@ |
||
45 | 45 | use OCP\ILogger; |
46 | 46 | use OCP\IRequest; |
47 | 47 | |
48 | -class SettingsController extends Controller |
|
49 | -{ |
|
48 | +class SettingsController extends Controller { |
|
50 | 49 | /** @var string */ |
51 | 50 | private $userId; |
52 | 51 |
@@ -26,8 +26,7 @@ |
||
26 | 26 | |
27 | 27 | use OCP\AppFramework\Http\EmptyContentSecurityPolicy; |
28 | 28 | |
29 | -class PicoContentSecurityPolicy extends EmptyContentSecurityPolicy |
|
30 | -{ |
|
29 | +class PicoContentSecurityPolicy extends EmptyContentSecurityPolicy { |
|
31 | 30 | /** @var bool Whether inline JS snippets are allowed */ |
32 | 31 | protected $inlineScriptAllowed = true; |
33 | 32 |
@@ -27,8 +27,7 @@ |
||
27 | 27 | use OCP\AppFramework\Http; |
28 | 28 | use OCP\AppFramework\Http\Response; |
29 | 29 | |
30 | -class NotModifiedResponse extends Response |
|
31 | -{ |
|
30 | +class NotModifiedResponse extends Response { |
|
32 | 31 | /** @var Response */ |
33 | 32 | private $originalResponse; |
34 | 33 |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | $lastModified = $file->getMTime(); |
77 | 77 | $mimeType = $file->getMimeType(); |
78 | 78 | |
79 | - if (($file->getPermissions() & Constants::PERMISSION_READ) !== Constants::PERMISSION_READ) { |
|
79 | + if (($file->getPermissions()&Constants::PERMISSION_READ) !== Constants::PERMISSION_READ) { |
|
80 | 80 | throw new NotPermittedException(); |
81 | 81 | } |
82 | 82 | } catch (InvalidPathException $e) { |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | */ |
123 | 123 | public function cacheFor(int $cacheSeconds): self |
124 | 124 | { |
125 | - if($cacheSeconds > 0) { |
|
125 | + if ($cacheSeconds > 0) { |
|
126 | 126 | $this->addHeader('Cache-Control', 'max-age=' . $cacheSeconds . ', public'); |
127 | 127 | $this->addHeader('Pragma', 'public'); |
128 | 128 |
@@ -32,8 +32,7 @@ |
||
32 | 32 | use OCP\Files\NotFoundException; |
33 | 33 | use OCP\Files\NotPermittedException; |
34 | 34 | |
35 | -class PicoFileResponse extends DownloadResponse |
|
36 | -{ |
|
35 | +class PicoFileResponse extends DownloadResponse { |
|
37 | 36 | /** @var File */ |
38 | 37 | private $file; |
39 | 38 |
@@ -28,8 +28,7 @@ |
||
28 | 28 | use OCP\AppFramework\Http\EmptyContentSecurityPolicy; |
29 | 29 | use OCP\AppFramework\Http\Response; |
30 | 30 | |
31 | -class PicoPageResponse extends Response |
|
32 | -{ |
|
31 | +class PicoPageResponse extends Response { |
|
33 | 32 | /** @var PicoPage */ |
34 | 33 | private $page; |
35 | 34 |
@@ -37,7 +37,7 @@ |
||
37 | 37 | */ |
38 | 38 | public function __construct(string $message = null) |
39 | 39 | { |
40 | - parent::__construct(Application::APP_NAME, '404', [ 'message' => $message ], 'guest'); |
|
40 | + parent::__construct(Application::APP_NAME, '404', ['message' => $message], 'guest'); |
|
41 | 41 | $this->setStatus(Http::STATUS_NOT_FOUND); |
42 | 42 | } |
43 | 43 | } |
@@ -28,8 +28,7 @@ |
||
28 | 28 | use OCP\AppFramework\Http; |
29 | 29 | use OCP\AppFramework\Http\TemplateResponse; |
30 | 30 | |
31 | -class NotFoundResponse extends TemplateResponse |
|
32 | -{ |
|
31 | +class NotFoundResponse extends TemplateResponse { |
|
33 | 32 | /** |
34 | 33 | * NotFoundResponse constructor. |
35 | 34 | * |
@@ -28,8 +28,7 @@ |
||
28 | 28 | use OCP\AppFramework\Http; |
29 | 29 | use OCP\AppFramework\Http\TemplateResponse; |
30 | 30 | |
31 | -class PicoErrorResponse extends TemplateResponse |
|
32 | -{ |
|
31 | +class PicoErrorResponse extends TemplateResponse { |
|
33 | 32 | /** @var \Exception|null */ |
34 | 33 | private $exception; |
35 | 34 |
@@ -37,7 +37,7 @@ |
||
37 | 37 | */ |
38 | 38 | public function __construct(string $message = null) |
39 | 39 | { |
40 | - parent::__construct(Application::APP_NAME, '403', [ 'message' => $message ], 'guest'); |
|
40 | + parent::__construct(Application::APP_NAME, '403', ['message' => $message], 'guest'); |
|
41 | 41 | $this->setStatus(Http::STATUS_FORBIDDEN); |
42 | 42 | } |
43 | 43 | } |
@@ -28,8 +28,7 @@ |
||
28 | 28 | use OCP\AppFramework\Http; |
29 | 29 | use OCP\AppFramework\Http\TemplateResponse; |
30 | 30 | |
31 | -class NotPermittedResponse extends TemplateResponse |
|
32 | -{ |
|
31 | +class NotPermittedResponse extends TemplateResponse { |
|
33 | 32 | /** |
34 | 33 | * NotPermittedResponse constructor. |
35 | 34 | * |