@@ -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#setLinkMode', 'url' => '/admin/link_mode', 'verb' => 'POST' ], |
|
89 | + ['name' => 'Settings#setLinkMode', 'url' => '/admin/link_mode', 'verb' => 'POST'], |
|
90 | 90 | ] |
91 | 91 | ]; |
92 | 92 |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | return; |
112 | 112 | } |
113 | 113 | |
114 | - $includeClosure = static function (string $pluginFile) { |
|
114 | + $includeClosure = static function(string $pluginFile) { |
|
115 | 115 | /** @noinspection PhpIncludeInspection */ |
116 | 116 | require($pluginFile); |
117 | 117 | }; |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | throw new PluginNotCompatibleException( |
122 | 122 | $this->getName(), |
123 | 123 | 'Incompatible plugin: Plugin file "{file}" not found.', |
124 | - [ 'file' => $this->getName() . '/' . $this->getName() . '.php' ] |
|
124 | + ['file' => $this->getName() . '/' . $this->getName() . '.php'] |
|
125 | 125 | ); |
126 | 126 | } |
127 | 127 | |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | throw new PluginNotCompatibleException( |
133 | 133 | $this->getName(), |
134 | 134 | 'Incompatible plugin: Plugin class "{class}" not found.', |
135 | - [ 'class' => $className ] |
|
135 | + ['class' => $className] |
|
136 | 136 | ); |
137 | 137 | } |
138 | 138 | |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | $this->getName(), |
148 | 148 | 'Incompatible plugin: Plugins for Pico CMS for Nextcloud must use API version {minApiVersion} ' |
149 | 149 | . 'or later, but this plugin uses API version {apiVersion}.', |
150 | - [ 'minApiVersion' => \Pico::API_VERSION, 'apiVersion' => $apiVersion ] |
|
150 | + ['minApiVersion' => \Pico::API_VERSION, 'apiVersion' => $apiVersion] |
|
151 | 151 | ); |
152 | 152 | } |
153 | 153 |
@@ -50,7 +50,7 @@ |
||
50 | 50 | */ |
51 | 51 | private function init() |
52 | 52 | { |
53 | - $this->folders = [ $this->folder ]; |
|
53 | + $this->folders = [$this->folder]; |
|
54 | 54 | $this->current = $this->folder; |
55 | 55 | $this->depth = 0; |
56 | 56 |
@@ -127,7 +127,7 @@ |
||
127 | 127 | */ |
128 | 128 | public function getPermissions(): int |
129 | 129 | { |
130 | - return Constants::PERMISSION_READ | Constants::PERMISSION_DELETE; |
|
130 | + return Constants::PERMISSION_READ|Constants::PERMISSION_DELETE; |
|
131 | 131 | } |
132 | 132 | |
133 | 133 | /** |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | |
161 | 161 | /** @var OCFolder $viewerOCFolder */ |
162 | 162 | $viewerOCFolder = \OC::$server->getUserFolder($this->getViewer()); |
163 | - $viewerAccessClosure = function (OCNode $node) use ($viewerOCFolder) { |
|
163 | + $viewerAccessClosure = function(OCNode $node) use ($viewerOCFolder) { |
|
164 | 164 | $nodeId = $node->getId(); |
165 | 165 | |
166 | 166 | $viewerNodes = $viewerOCFolder->getById($nodeId); |
@@ -357,7 +357,7 @@ discard block |
||
357 | 357 | { |
358 | 358 | if (!$this->getProxyRequest()) { |
359 | 359 | $route = Application::APP_NAME . '.Pico.getPage'; |
360 | - $parameters = [ 'site' => $this->getSite(), 'page' => '' ]; |
|
360 | + $parameters = ['site' => $this->getSite(), 'page' => '']; |
|
361 | 361 | return $this->urlGenerator->linkToRoute($route, $parameters) . '/'; |
362 | 362 | } else { |
363 | 363 | return \OC::$WEBROOT . '/sites/' . urlencode($this->getSite()) . '/'; |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | throw $e; |
156 | 156 | } catch (\Exception $e) { |
157 | 157 | $exception = new PicoRuntimeException($e); |
158 | - $this->logger->logException($exception, [ 'app' => Application::APP_NAME ]); |
|
158 | + $this->logger->logException($exception, ['app' => Application::APP_NAME]); |
|
159 | 159 | throw $exception; |
160 | 160 | } |
161 | 161 | |
@@ -210,7 +210,7 @@ discard block |
||
210 | 210 | */ |
211 | 211 | private function loadPicoPlugins(Pico $pico) |
212 | 212 | { |
213 | - $includeClosure = static function (string $pluginFile) { |
|
213 | + $includeClosure = static function(string $pluginFile) { |
|
214 | 214 | /** @noinspection PhpIncludeInspection */ |
215 | 215 | require($pluginFile); |
216 | 216 | }; |
@@ -275,7 +275,7 @@ discard block |
||
275 | 275 | } |
276 | 276 | } |
277 | 277 | |
278 | - return [ $folder, rtrim($basePath, '/'), $relativePath ]; |
|
278 | + return [$folder, rtrim($basePath, '/'), $relativePath]; |
|
279 | 279 | } |
280 | 280 | |
281 | 281 | /** |
@@ -205,7 +205,7 @@ discard block |
||
205 | 205 | if ($this->htmlPurifier === null) { |
206 | 206 | $this->htmlPurifier = new HTMLPurifier(HTMLPurifier_Config::createDefault()); |
207 | 207 | |
208 | - $this->triggerEvent('onHtmlPurifier', [ &$this->htmlPurifier ]); |
|
208 | + $this->triggerEvent('onHtmlPurifier', [&$this->htmlPurifier]); |
|
209 | 209 | } |
210 | 210 | |
211 | 211 | return $this->htmlPurifier; |
@@ -231,12 +231,12 @@ discard block |
||
231 | 231 | return parent::getFiles($absolutePath, $fileExtension, $order); |
232 | 232 | } |
233 | 233 | |
234 | - $folderFilter = function (NodeInterface $node, int $key, FolderInterface $folder) use ($fileExtension) { |
|
234 | + $folderFilter = function(NodeInterface $node, int $key, FolderInterface $folder) use ($fileExtension) { |
|
235 | 235 | $fileName = $node->getName(); |
236 | 236 | |
237 | 237 | // exclude hidden files/dirs starting with a . |
238 | 238 | // exclude files ending with a ~ (vim/nano backup) or # (emacs backup) |
239 | - if (($fileName[0] === '.') || in_array(substr($fileName, -1), [ '~', '#' ], true)) { |
|
239 | + if (($fileName[0] === '.') || in_array(substr($fileName, -1), ['~', '#'], true)) { |
|
240 | 240 | return false; |
241 | 241 | } |
242 | 242 | |
@@ -289,7 +289,7 @@ discard block |
||
289 | 289 | $fileName = $file->getName(); |
290 | 290 | |
291 | 291 | // exclude files ending with a ~ (vim/nano backup) or # (emacs backup) |
292 | - if (in_array(substr($fileName, -1), [ '~', '#' ], true)) { |
|
292 | + if (in_array(substr($fileName, -1), ['~', '#'], true)) { |
|
293 | 293 | continue; |
294 | 294 | } |
295 | 295 |
@@ -25,7 +25,7 @@ |
||
25 | 25 | |
26 | 26 | /** @var $_ array */ |
27 | 27 | /** @var $l \OCP\IL10N */ |
28 | -script(Application::APP_NAME, [ 'pico', 'personal' ]); |
|
28 | +script(Application::APP_NAME, ['pico', 'personal']); |
|
29 | 29 | style(Application::APP_NAME, 'pico'); |
30 | 30 | |
31 | 31 | ?> |
@@ -31,6 +31,6 @@ |
||
31 | 31 | <h2><?php p($l->t('Internal Server Error')); ?></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> |