@@ -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 | } |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | */ |
| 117 | 117 | public function getPersonalWebsites(): DataResponse |
| 118 | 118 | { |
| 119 | - $data = [ 'websites' => $this->websitesService->getWebsitesFromUser($this->userId) ]; |
|
| 119 | + $data = ['websites' => $this->websitesService->getWebsitesFromUser($this->userId)]; |
|
| 120 | 120 | return new DataResponse($data, Http::STATUS_OK); |
| 121 | 121 | } |
| 122 | 122 | |
@@ -144,17 +144,17 @@ discard block |
||
| 144 | 144 | } catch (\Exception $e) { |
| 145 | 145 | $data = []; |
| 146 | 146 | if ($e instanceof WebsiteExistsException) { |
| 147 | - $data['form_error'] = [ 'field' => 'site', 'message' => $this->l10n->t('Website exists.') ]; |
|
| 147 | + $data['form_error'] = ['field' => 'site', 'message' => $this->l10n->t('Website exists.')]; |
|
| 148 | 148 | } elseif ($e instanceof WebsiteInvalidOwnerException) { |
| 149 | - $data['form_error'] = [ 'field' => 'user', 'message' => $this->l10n->t('No permission.') ]; |
|
| 149 | + $data['form_error'] = ['field' => 'user', 'message' => $this->l10n->t('No permission.')]; |
|
| 150 | 150 | } elseif (($e instanceof WebsiteInvalidDataException) && $e->getField()) { |
| 151 | - $data['form_error'] = [ 'field' => $e->getField(), 'message' => $e->getMessage() ]; |
|
| 151 | + $data['form_error'] = ['field' => $e->getField(), 'message' => $e->getMessage()]; |
|
| 152 | 152 | } elseif ($e instanceof ThemeNotFoundException) { |
| 153 | - $data['form_error'] = [ 'field' => 'theme', 'message' => $this->l10n->t('Theme not found.') ]; |
|
| 153 | + $data['form_error'] = ['field' => 'theme', 'message' => $this->l10n->t('Theme not found.')]; |
|
| 154 | 154 | } elseif ($e instanceof ThemeNotCompatibleException) { |
| 155 | - $data['form_error'] = [ 'field' => 'theme', 'message' => $this->l10n->t($e->getReason()) ]; |
|
| 155 | + $data['form_error'] = ['field' => 'theme', 'message' => $this->l10n->t($e->getReason())]; |
|
| 156 | 156 | } elseif ($e instanceof TemplateNotFoundException) { |
| 157 | - $data['form_error'] = [ 'field' => 'template', 'message' => $this->l10n->t('Template not found.') ]; |
|
| 157 | + $data['form_error'] = ['field' => 'template', 'message' => $this->l10n->t('Template not found.')]; |
|
| 158 | 158 | } |
| 159 | 159 | |
| 160 | 160 | return $this->createErrorResponse($e, $data); |
@@ -197,15 +197,15 @@ discard block |
||
| 197 | 197 | } catch (\Exception $e) { |
| 198 | 198 | $data = []; |
| 199 | 199 | if (($e instanceof WebsiteNotFoundException) || ($e instanceof WebsiteForeignOwnerException)) { |
| 200 | - $data['form_error'] = [ 'field' => 'identifier', 'message' => $this->l10n->t('Website not found.') ]; |
|
| 200 | + $data['form_error'] = ['field' => 'identifier', 'message' => $this->l10n->t('Website not found.')]; |
|
| 201 | 201 | } elseif ($e instanceof WebsiteInvalidDataException) { |
| 202 | - $data['form_error'] = [ 'field' => $e->getField(), 'message' => $e->getMessage() ]; |
|
| 202 | + $data['form_error'] = ['field' => $e->getField(), 'message' => $e->getMessage()]; |
|
| 203 | 203 | } elseif ($e instanceof ThemeNotFoundException) { |
| 204 | - $data['form_error'] = [ 'field' => 'theme', 'message' => $this->l10n->t('Theme not found.') ]; |
|
| 204 | + $data['form_error'] = ['field' => 'theme', 'message' => $this->l10n->t('Theme not found.')]; |
|
| 205 | 205 | } elseif ($e instanceof ThemeNotCompatibleException) { |
| 206 | - $data['form_error'] = [ 'field' => 'theme', 'message' => $this->l10n->t($e->getReason()) ]; |
|
| 206 | + $data['form_error'] = ['field' => 'theme', 'message' => $this->l10n->t($e->getReason())]; |
|
| 207 | 207 | } elseif ($e instanceof TemplateNotFoundException) { |
| 208 | - $data['form_error'] = [ 'field' => 'template', 'message' => $this->l10n->t('Template not found.') ]; |
|
| 208 | + $data['form_error'] = ['field' => 'template', 'message' => $this->l10n->t('Template not found.')]; |
|
| 209 | 209 | } |
| 210 | 210 | |
| 211 | 211 | return $this->createErrorResponse($e, $data); |
@@ -469,7 +469,7 @@ discard block |
||
| 469 | 469 | */ |
| 470 | 470 | private function createErrorResponse(\Exception $exception, array $data = []): DataResponse |
| 471 | 471 | { |
| 472 | - $this->logger->logException($exception, [ 'app' => Application::APP_NAME, 'level' => 2 ]); |
|
| 472 | + $this->logger->logException($exception, ['app' => Application::APP_NAME, 'level' => 2]); |
|
| 473 | 473 | |
| 474 | 474 | $data['status'] = 0; |
| 475 | 475 | if (\OC::$server->getSystemConfig()->getValue('debug', false)) { |
@@ -27,21 +27,21 @@ discard block |
||
| 27 | 27 | 'name' => 'Pico#getAsset', |
| 28 | 28 | 'url' => '/pico/{site}/assets/{asset}', |
| 29 | 29 | 'verb' => 'GET', |
| 30 | - 'requirements' => [ 'asset' => '.+' ] |
|
| 30 | + 'requirements' => ['asset' => '.+'] |
|
| 31 | 31 | ], |
| 32 | 32 | [ |
| 33 | 33 | 'name' => 'Pico#getAsset', |
| 34 | 34 | 'postfix' => 'ETag', |
| 35 | 35 | 'url' => '/pico/{site}/assets-{assetsETag}/{asset}', |
| 36 | 36 | 'verb' => 'GET', |
| 37 | - 'requirements' => [ 'asset' => '.+' ] |
|
| 37 | + 'requirements' => ['asset' => '.+'] |
|
| 38 | 38 | ], |
| 39 | 39 | [ |
| 40 | 40 | 'name' => 'Pico#getPage', |
| 41 | 41 | 'url' => '/pico/{site}/{page}', |
| 42 | 42 | 'verb' => 'GET', |
| 43 | - 'defaults' => [ 'page' => '' ], |
|
| 44 | - 'requirements' => [ 'page' => '.*' ] |
|
| 43 | + 'defaults' => ['page' => ''], |
|
| 44 | + 'requirements' => ['page' => '.*'] |
|
| 45 | 45 | ], |
| 46 | 46 | |
| 47 | 47 | [ |
@@ -49,44 +49,44 @@ discard block |
||
| 49 | 49 | 'postfix' => 'Proxy', |
| 50 | 50 | 'url' => '/pico_proxy/{site}/assets/{asset}', |
| 51 | 51 | 'verb' => 'GET', |
| 52 | - 'requirements' => [ 'asset' => '.+' ] |
|
| 52 | + 'requirements' => ['asset' => '.+'] |
|
| 53 | 53 | ], |
| 54 | 54 | [ |
| 55 | 55 | 'name' => 'Pico#getAsset', |
| 56 | 56 | 'postfix' => 'ProxyETag', |
| 57 | 57 | 'url' => '/pico_proxy/{site}/assets-{assetsETag}/{asset}', |
| 58 | 58 | 'verb' => 'GET', |
| 59 | - 'requirements' => [ 'asset' => '.+' ] |
|
| 59 | + 'requirements' => ['asset' => '.+'] |
|
| 60 | 60 | ], |
| 61 | 61 | [ |
| 62 | 62 | 'name' => 'Pico#getPage', |
| 63 | 63 | 'postfix' => 'Proxy', |
| 64 | 64 | 'url' => '/pico_proxy/{site}/{page}', |
| 65 | 65 | 'verb' => 'GET', |
| 66 | - 'defaults' => [ 'page' => '', 'proxyRequest' => true ], |
|
| 67 | - 'requirements' => [ 'page' => '.*' ] |
|
| 66 | + 'defaults' => ['page' => '', 'proxyRequest' => true], |
|
| 67 | + 'requirements' => ['page' => '.*'] |
|
| 68 | 68 | ], |
| 69 | 69 | |
| 70 | - [ 'name' => 'Settings#getPersonalWebsites', 'url' => '/personal/websites', 'verb' => 'GET' ], |
|
| 71 | - [ 'name' => 'Settings#createPersonalWebsite', 'url' => '/personal/websites', 'verb' => 'POST' ], |
|
| 72 | - [ 'name' => 'Settings#updatePersonalWebsite', 'url' => '/personal/websites/{siteId}', 'verb' => 'POST' ], |
|
| 73 | - [ 'name' => 'Settings#removePersonalWebsite', 'url' => '/personal/websites/{siteId}', 'verb' => 'DELETE' ], |
|
| 70 | + ['name' => 'Settings#getPersonalWebsites', 'url' => '/personal/websites', 'verb' => 'GET'], |
|
| 71 | + ['name' => 'Settings#createPersonalWebsite', 'url' => '/personal/websites', 'verb' => 'POST'], |
|
| 72 | + ['name' => 'Settings#updatePersonalWebsite', 'url' => '/personal/websites/{siteId}', 'verb' => 'POST'], |
|
| 73 | + ['name' => 'Settings#removePersonalWebsite', 'url' => '/personal/websites/{siteId}', 'verb' => 'DELETE'], |
|
| 74 | 74 | |
| 75 | - [ 'name' => 'Settings#getTemplates', 'url' => '/admin/templates', 'verb' => 'GET' ], |
|
| 76 | - [ 'name' => 'Settings#addCustomTemplate', 'url' => '/admin/templates', 'verb' => 'POST' ], |
|
| 77 | - [ 'name' => 'Settings#removeCustomTemplate', 'url' => '/admin/templates/{item}', 'verb' => 'DELETE' ], |
|
| 75 | + ['name' => 'Settings#getTemplates', 'url' => '/admin/templates', 'verb' => 'GET'], |
|
| 76 | + ['name' => 'Settings#addCustomTemplate', 'url' => '/admin/templates', 'verb' => 'POST'], |
|
| 77 | + ['name' => 'Settings#removeCustomTemplate', 'url' => '/admin/templates/{item}', 'verb' => 'DELETE'], |
|
| 78 | 78 | |
| 79 | - [ 'name' => 'Settings#getThemes', 'url' => '/admin/themes', 'verb' => 'GET' ], |
|
| 80 | - [ 'name' => 'Settings#addCustomTheme', 'url' => '/admin/themes', 'verb' => 'POST' ], |
|
| 81 | - [ 'name' => 'Settings#updateCustomTheme', 'url' => '/admin/themes/{item}', 'verb' => 'POST' ], |
|
| 82 | - [ 'name' => 'Settings#removeCustomTheme', 'url' => '/admin/themes/{item}', 'verb' => 'DELETE' ], |
|
| 79 | + ['name' => 'Settings#getThemes', 'url' => '/admin/themes', 'verb' => 'GET'], |
|
| 80 | + ['name' => 'Settings#addCustomTheme', 'url' => '/admin/themes', 'verb' => 'POST'], |
|
| 81 | + ['name' => 'Settings#updateCustomTheme', 'url' => '/admin/themes/{item}', 'verb' => 'POST'], |
|
| 82 | + ['name' => 'Settings#removeCustomTheme', 'url' => '/admin/themes/{item}', 'verb' => 'DELETE'], |
|
| 83 | 83 | |
| 84 | - [ 'name' => 'Settings#getPlugins', 'url' => '/admin/plugins', 'verb' => 'GET' ], |
|
| 85 | - [ 'name' => 'Settings#addCustomPlugin', 'url' => '/admin/plugins', 'verb' => 'POST' ], |
|
| 86 | - [ 'name' => 'Settings#updateCustomPlugin', 'url' => '/admin/plugins/{item}', 'verb' => 'POST' ], |
|
| 87 | - [ 'name' => 'Settings#removeCustomPlugin', 'url' => '/admin/plugins/{item}', 'verb' => 'DELETE' ], |
|
| 84 | + ['name' => 'Settings#getPlugins', 'url' => '/admin/plugins', 'verb' => 'GET'], |
|
| 85 | + ['name' => 'Settings#addCustomPlugin', 'url' => '/admin/plugins', 'verb' => 'POST'], |
|
| 86 | + ['name' => 'Settings#updateCustomPlugin', 'url' => '/admin/plugins/{item}', 'verb' => 'POST'], |
|
| 87 | + ['name' => 'Settings#removeCustomPlugin', 'url' => '/admin/plugins/{item}', 'verb' => 'DELETE'], |
|
| 88 | 88 | |
| 89 | - [ 'name' => 'Settings#setLimitGroups', 'url' => '/admin/limit_groups', 'verb' => 'POST' ], |
|
| 90 | - [ 'name' => 'Settings#setLinkMode', 'url' => '/admin/link_mode', 'verb' => 'POST' ], |
|
| 89 | + ['name' => 'Settings#setLimitGroups', 'url' => '/admin/limit_groups', 'verb' => 'POST'], |
|
| 90 | + ['name' => 'Settings#setLinkMode', 'url' => '/admin/link_mode', 'verb' => 'POST'], |
|
| 91 | 91 | ] |
| 92 | 92 | ]; |
@@ -206,7 +206,7 @@ discard block |
||
| 206 | 206 | $htmlPurifierConfig = HTMLPurifier_HTML5Config::createDefault(); |
| 207 | 207 | $this->htmlPurifier = new HTMLPurifier($htmlPurifierConfig); |
| 208 | 208 | |
| 209 | - $this->triggerEvent('onHtmlPurifier', [ &$this->htmlPurifier ]); |
|
| 209 | + $this->triggerEvent('onHtmlPurifier', [&$this->htmlPurifier]); |
|
| 210 | 210 | } |
| 211 | 211 | |
| 212 | 212 | return $this->htmlPurifier; |
@@ -232,12 +232,12 @@ discard block |
||
| 232 | 232 | return parent::getFiles($absolutePath, $fileExtension, $order); |
| 233 | 233 | } |
| 234 | 234 | |
| 235 | - $folderFilter = function (NodeInterface $node, int $key, FolderInterface $folder) use ($fileExtension) { |
|
| 235 | + $folderFilter = function(NodeInterface $node, int $key, FolderInterface $folder) use ($fileExtension) { |
|
| 236 | 236 | $fileName = $node->getName(); |
| 237 | 237 | |
| 238 | 238 | // exclude hidden files/dirs starting with a . |
| 239 | 239 | // exclude files ending with a ~ (vim/nano backup) or # (emacs backup) |
| 240 | - if (($fileName[0] === '.') || in_array(substr($fileName, -1), [ '~', '#' ], true)) { |
|
| 240 | + if (($fileName[0] === '.') || in_array(substr($fileName, -1), ['~', '#'], true)) { |
|
| 241 | 241 | return false; |
| 242 | 242 | } |
| 243 | 243 | |
@@ -290,7 +290,7 @@ discard block |
||
| 290 | 290 | $fileName = $file->getName(); |
| 291 | 291 | |
| 292 | 292 | // exclude files ending with a ~ (vim/nano backup) or # (emacs backup) |
| 293 | - if (in_array(substr($fileName, -1), [ '~', '#' ], true)) { |
|
| 293 | + if (in_array(substr($fileName, -1), ['~', '#'], true)) { |
|
| 294 | 294 | continue; |
| 295 | 295 | } |
| 296 | 296 | |