Passed
Pull Request — master (#77)
by Daniel
03:08
created
lib/Controller/SettingsController.php 2 patches
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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)) {
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -45,8 +45,7 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
lib/Http/PicoContentSecurityPolicy.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -26,8 +26,7 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
lib/Http/NotModifiedResponse.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -27,8 +27,7 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
lib/Http/PicoFileResponse.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -32,8 +32,7 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
lib/Http/PicoPageResponse.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -28,8 +28,7 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
lib/Http/NotFoundResponse.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -28,8 +28,7 @@
 block discarded – undo
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
 	 *
Please login to merge, or discard this patch.
lib/Http/PicoErrorResponse.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -28,8 +28,7 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
lib/Http/NotPermittedResponse.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -28,8 +28,7 @@
 block discarded – undo
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
 	 *
Please login to merge, or discard this patch.
lib/Pico.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -178,7 +178,7 @@
 block discarded – undo
178 178
 		if ($this->htmlPurifier === null) {
179 179
 			$this->htmlPurifier = new HTMLPurifier(HTMLPurifier_Config::createDefault());
180 180
 
181
-			$this->triggerEvent('onHtmlPurifier', [ &$this->htmlPurifier ]);
181
+			$this->triggerEvent('onHtmlPurifier', [&$this->htmlPurifier]);
182 182
 		}
183 183
 
184 184
 		return $this->htmlPurifier;
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -34,8 +34,7 @@
 block discarded – undo
34 34
 use OCA\CMSPico\Model\Website;
35 35
 use Symfony\Component\Yaml\Exception\ParseException;
36 36
 
37
-class Pico extends \Pico
38
-{
37
+class Pico extends \Pico {
39 38
 	/** @var HTMLPurifier */
40 39
 	protected $htmlPurifier;
41 40
 
Please login to merge, or discard this patch.