@@ -31,6 +31,6 @@ |
||
31 | 31 | <h2><?php p($l->t('Not found')); ?></h2> |
32 | 32 | <p class="infogroup"><?php p($_['message'] ?? ''); ?></p> |
33 | 33 | <p><a class="button primary" href="<?php p(\OC::$server->getURLGenerator()->linkTo('', 'index.php')); ?>"> |
34 | - <?php p($l->t('Back to %s', [ $theme->getName() ])); ?> |
|
34 | + <?php p($l->t('Back to %s', [$theme->getName()])); ?> |
|
35 | 35 | </a></p> |
36 | 36 | </div> |
@@ -31,6 +31,6 @@ |
||
31 | 31 | <h2><?php p($l->t('Access forbidden')); ?></h2> |
32 | 32 | <p class="infogroup"><?php p($_['message'] ?? ''); ?></p> |
33 | 33 | <p><a class="button primary" href="<?php p(\OC::$server->getURLGenerator()->linkTo('', 'index.php')); ?>"> |
34 | - <?php p($l->t('Back to %s', [ $theme->getName() ])); ?> |
|
34 | + <?php p($l->t('Back to %s', [$theme->getName()])); ?> |
|
35 | 35 | </a></p> |
36 | 36 | </div> |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | <p class="infogroup"><?php p($l->t('More details can be found in the server log.')); ?></p> |
43 | 43 | |
44 | 44 | <p><a class="button primary" href="<?php p(\OC::$server->getURLGenerator()->linkTo('', 'index.php')); ?>"> |
45 | - <?php p($l->t('Back to %s', [ $theme->getName() ])); ?> |
|
45 | + <?php p($l->t('Back to %s', [$theme->getName()])); ?> |
|
46 | 46 | </a></p> |
47 | 47 | </div> |
48 | 48 | |
@@ -50,13 +50,13 @@ discard block |
||
50 | 50 | <div class="error error-wide"> |
51 | 51 | <h2><?php p($l->t('Technical details')); ?></h2> |
52 | 52 | <ul> |
53 | - <li><?php p($l->t('Remote Address: %s', [ $_['remoteAddr'] ])); ?></li> |
|
54 | - <li><?php p($l->t('Request ID: %s', [ $_['requestID'] ])); ?></li> |
|
55 | - <li><?php p($l->t('Type: %s', [ $_['errorClass'] ])); ?></li> |
|
56 | - <li><?php p($l->t('Code: %s', [ $_['errorCode'] ])); ?></li> |
|
57 | - <li><?php p($l->t('Message: %s', [ $_['errorMsg'] ])); ?></li> |
|
58 | - <li><?php p($l->t('File: %s', [ $_['errorFile'] ])); ?></li> |
|
59 | - <li><?php p($l->t('Line: %s', [ $_['errorLine'] ])); ?></li> |
|
53 | + <li><?php p($l->t('Remote Address: %s', [$_['remoteAddr']])); ?></li> |
|
54 | + <li><?php p($l->t('Request ID: %s', [$_['requestID']])); ?></li> |
|
55 | + <li><?php p($l->t('Type: %s', [$_['errorClass']])); ?></li> |
|
56 | + <li><?php p($l->t('Code: %s', [$_['errorCode']])); ?></li> |
|
57 | + <li><?php p($l->t('Message: %s', [$_['errorMsg']])); ?></li> |
|
58 | + <li><?php p($l->t('File: %s', [$_['errorFile']])); ?></li> |
|
59 | + <li><?php p($l->t('Line: %s', [$_['errorLine']])); ?></li> |
|
60 | 60 | </ul> |
61 | 61 | |
62 | 62 | <br /> |
@@ -39,13 +39,13 @@ discard block |
||
39 | 39 | protected $delimiter = '~'; |
40 | 40 | |
41 | 41 | /** @var string[] */ |
42 | - protected $functionChars = [ '*', '?', '[' ]; |
|
42 | + protected $functionChars = ['*', '?', '[']; |
|
43 | 43 | |
44 | 44 | /** @var string[] */ |
45 | - protected $specialChars = [ '*', '?', '[', ']', '-', '\\' ]; |
|
45 | + protected $specialChars = ['*', '?', '[', ']', '-', '\\']; |
|
46 | 46 | |
47 | 47 | /** @var string[] */ |
48 | - protected $escapeChars = [ '.', '+', '^', '$', '(', ')', '{', '}', '=', '!', '<', '>', '|', ':', '#', '~' ]; |
|
48 | + protected $escapeChars = ['.', '+', '^', '$', '(', ')', '{', '}', '=', '!', '<', '>', '|', ':', '#', '~']; |
|
49 | 49 | |
50 | 50 | /** @var string */ |
51 | 51 | protected $pattern; |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | { |
107 | 107 | while (!isset($this->components[$depth])) { |
108 | 108 | if ($this->patternPos === $this->patternLength) { |
109 | - return [ self::TYPE_NONE, '' ]; |
|
109 | + return [self::TYPE_NONE, '']; |
|
110 | 110 | } |
111 | 111 | |
112 | 112 | $this->evaluateComponent(); |
@@ -212,10 +212,10 @@ discard block |
||
212 | 212 | } |
213 | 213 | |
214 | 214 | if ($this->context['isStatic']) { |
215 | - $this->components[] = [ self::TYPE_STATIC, $this->current ]; |
|
215 | + $this->components[] = [self::TYPE_STATIC, $this->current]; |
|
216 | 216 | } else { |
217 | 217 | $regex = $this->delimiter . '^' . $this->current . '$' . $this->delimiter; |
218 | - $this->components[] = [ self::TYPE_REGEX, $regex ]; |
|
218 | + $this->components[] = [self::TYPE_REGEX, $regex]; |
|
219 | 219 | } |
220 | 220 | } |
221 | 221 |
@@ -188,7 +188,7 @@ |
||
188 | 188 | */ |
189 | 189 | public function setType(int $type): self |
190 | 190 | { |
191 | - if (!in_array($type, [ self::TYPE_PUBLIC, self::TYPE_PRIVATE ], true)) { |
|
191 | + if (!in_array($type, [self::TYPE_PUBLIC, self::TYPE_PRIVATE], true)) { |
|
192 | 192 | throw new \UnexpectedValueException(); |
193 | 193 | } |
194 | 194 |
@@ -145,11 +145,11 @@ discard block |
||
145 | 145 | } |
146 | 146 | |
147 | 147 | if (!$table->hasIndex('user_id')) { |
148 | - $table->addIndex([ 'user_id' ], 'user_id'); |
|
148 | + $table->addIndex(['user_id'], 'user_id'); |
|
149 | 149 | } |
150 | 150 | |
151 | 151 | if (!$table->hasIndex('site')) { |
152 | - $table->addIndex([ 'site' ], 'site'); |
|
152 | + $table->addIndex(['site'], 'site'); |
|
153 | 153 | } |
154 | 154 | |
155 | 155 | return $schema; |
@@ -223,7 +223,7 @@ discard block |
||
223 | 223 | 'Failed to enable Pico CMS for Nextcloud: Couldn\'t find "%s". Make sure to install the app\'s ' |
224 | 224 | . 'dependencies by executing `composer install` in the app\'s install directory below "%s". ' |
225 | 225 | . 'Then try again enabling Pico CMS for Nextcloud.', |
226 | - [ $relativeAppPath . 'vendor/autoload.php', $relativeAppPath ] |
|
226 | + [$relativeAppPath . 'vendor/autoload.php', $relativeAppPath] |
|
227 | 227 | )); |
228 | 228 | } |
229 | 229 | } |
@@ -275,7 +275,7 @@ discard block |
||
275 | 275 | . 'folders below "%s". Make sure to give the webserver write access to this directory by ' |
276 | 276 | . 'changing its permissions and ownership to the same as of your "%s" directory. Then try ' |
277 | 277 | . 'again enabling Pico CMS for Nextcloud.', |
278 | - [ $appDataPublicPath, $dataPath ] |
|
278 | + [$appDataPublicPath, $dataPath] |
|
279 | 279 | )); |
280 | 280 | } |
281 | 281 | } |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | */ |
116 | 116 | public function getPersonalWebsites(): DataResponse |
117 | 117 | { |
118 | - $data = [ 'websites' => $this->websitesService->getWebsitesFromUser($this->userId) ]; |
|
118 | + $data = ['websites' => $this->websitesService->getWebsitesFromUser($this->userId)]; |
|
119 | 119 | return new DataResponse($data, Http::STATUS_OK); |
120 | 120 | } |
121 | 121 | |
@@ -143,15 +143,15 @@ discard block |
||
143 | 143 | } catch (\Exception $e) { |
144 | 144 | $data = []; |
145 | 145 | if ($e instanceof WebsiteExistsException) { |
146 | - $data['form_error'] = [ 'field' => 'site', 'message' => $this->l10n->t('Website exists.') ]; |
|
146 | + $data['form_error'] = ['field' => 'site', 'message' => $this->l10n->t('Website exists.')]; |
|
147 | 147 | } elseif (($e instanceof WebsiteInvalidDataException) && $e->getField()) { |
148 | - $data['form_error'] = [ 'field' => $e->getField(), 'message' => $e->getMessage() ]; |
|
148 | + $data['form_error'] = ['field' => $e->getField(), 'message' => $e->getMessage()]; |
|
149 | 149 | } elseif ($e instanceof ThemeNotFoundException) { |
150 | - $data['form_error'] = [ 'field' => 'theme', 'message' => $this->l10n->t('Theme not found.') ]; |
|
150 | + $data['form_error'] = ['field' => 'theme', 'message' => $this->l10n->t('Theme not found.')]; |
|
151 | 151 | } elseif ($e instanceof ThemeNotCompatibleException) { |
152 | - $data['form_error'] = [ 'field' => 'theme', 'message' => $this->l10n->t($e->getReason()) ]; |
|
152 | + $data['form_error'] = ['field' => 'theme', 'message' => $this->l10n->t($e->getReason())]; |
|
153 | 153 | } elseif ($e instanceof TemplateNotFoundException) { |
154 | - $data['form_error'] = [ 'field' => 'template', 'message' => $this->l10n->t('Template not found.') ]; |
|
154 | + $data['form_error'] = ['field' => 'template', 'message' => $this->l10n->t('Template not found.')]; |
|
155 | 155 | } |
156 | 156 | |
157 | 157 | return $this->createErrorResponse($e, $data); |
@@ -194,15 +194,15 @@ discard block |
||
194 | 194 | } catch (\Exception $e) { |
195 | 195 | $data = []; |
196 | 196 | if (($e instanceof WebsiteNotFoundException) || ($e instanceof WebsiteForeignOwnerException)) { |
197 | - $data['form_error'] = [ 'field' => 'identifier', 'message' => $this->l10n->t('Website not found.') ]; |
|
197 | + $data['form_error'] = ['field' => 'identifier', 'message' => $this->l10n->t('Website not found.')]; |
|
198 | 198 | } elseif ($e instanceof WebsiteInvalidDataException) { |
199 | - $data['form_error'] = [ 'field' => $e->getField(), 'message' => $e->getMessage() ]; |
|
199 | + $data['form_error'] = ['field' => $e->getField(), 'message' => $e->getMessage()]; |
|
200 | 200 | } elseif ($e instanceof ThemeNotFoundException) { |
201 | - $data['form_error'] = [ 'field' => 'theme', 'message' => $this->l10n->t('Theme not found.') ]; |
|
201 | + $data['form_error'] = ['field' => 'theme', 'message' => $this->l10n->t('Theme not found.')]; |
|
202 | 202 | } elseif ($e instanceof ThemeNotCompatibleException) { |
203 | - $data['form_error'] = [ 'field' => 'theme', 'message' => $this->l10n->t($e->getReason()) ]; |
|
203 | + $data['form_error'] = ['field' => 'theme', 'message' => $this->l10n->t($e->getReason())]; |
|
204 | 204 | } elseif ($e instanceof TemplateNotFoundException) { |
205 | - $data['form_error'] = [ 'field' => 'template', 'message' => $this->l10n->t('Template not found.') ]; |
|
205 | + $data['form_error'] = ['field' => 'template', 'message' => $this->l10n->t('Template not found.')]; |
|
206 | 206 | } |
207 | 207 | |
208 | 208 | return $this->createErrorResponse($e, $data); |
@@ -445,7 +445,7 @@ discard block |
||
445 | 445 | */ |
446 | 446 | private function createErrorResponse(\Exception $exception, array $data = []): DataResponse |
447 | 447 | { |
448 | - $this->logger->logException($exception, [ 'app' => Application::APP_NAME, 'level' => 2 ]); |
|
448 | + $this->logger->logException($exception, ['app' => Application::APP_NAME, 'level' => 2]); |
|
449 | 449 | |
450 | 450 | $data['status'] = 0; |
451 | 451 | if (\OC::$server->getSystemConfig()->getValue('debug', false)) { |