@@ -125,6 +125,6 @@ |
||
125 | 125 | */ |
126 | 126 | public function getPermissions(): int |
127 | 127 | { |
128 | - return Constants::PERMISSION_READ | Constants::PERMISSION_UPDATE | Constants::PERMISSION_DELETE; |
|
128 | + return Constants::PERMISSION_READ|Constants::PERMISSION_UPDATE|Constants::PERMISSION_DELETE; |
|
129 | 129 | } |
130 | 130 | } |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | |
70 | 70 | if (!@rmdir($this->getLocalPath())) { |
71 | 71 | $files = @scandir($this->getLocalPath()); |
72 | - if (($files === false) || ($files === [ '.', '..' ])) { |
|
72 | + if (($files === false) || ($files === ['.', '..'])) { |
|
73 | 73 | throw new GenericFileException(); |
74 | 74 | } else { |
75 | 75 | throw new NotPermittedException(); |
@@ -203,7 +203,7 @@ discard block |
||
203 | 203 | */ |
204 | 204 | public function isCreatable(): bool |
205 | 205 | { |
206 | - return ($this->getPermissions() & Constants::PERMISSION_CREATE) === Constants::PERMISSION_CREATE; |
|
206 | + return ($this->getPermissions()&Constants::PERMISSION_CREATE) === Constants::PERMISSION_CREATE; |
|
207 | 207 | } |
208 | 208 | |
209 | 209 | /** |
@@ -188,7 +188,7 @@ discard block |
||
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 | |
@@ -411,15 +411,15 @@ discard block |
||
411 | 411 | |
412 | 412 | $creation = 0; |
413 | 413 | if (!empty($data['creation'])) { |
414 | - $creation = is_numeric($data['creation']) ? (int) $data['creation'] : strtotime($data['creation']); |
|
414 | + $creation = is_numeric($data['creation']) ? (int)$data['creation'] : strtotime($data['creation']); |
|
415 | 415 | } |
416 | 416 | |
417 | - $this->setId(isset($data['id']) ? (int) $data['id'] : 0) |
|
417 | + $this->setId(isset($data['id']) ? (int)$data['id'] : 0) |
|
418 | 418 | ->setUserId($data['user_id']) |
419 | 419 | ->setName($data['name']) |
420 | 420 | ->setSite($data['site']) |
421 | 421 | ->setTheme($data['theme'] ?? 'default') |
422 | - ->setType(isset($data['type']) ? (int) $data['type'] : self::TYPE_PUBLIC) |
|
422 | + ->setType(isset($data['type']) ? (int)$data['type'] : self::TYPE_PUBLIC) |
|
423 | 423 | ->setOptions($options) |
424 | 424 | ->setPath($data['path']) |
425 | 425 | ->setCreation($creation) |
@@ -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 | } |
@@ -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 | } |
@@ -178,7 +178,7 @@ |
||
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; |
@@ -139,7 +139,7 @@ |
||
139 | 139 | */ |
140 | 140 | public function installTemplates(Website $website) |
141 | 141 | { |
142 | - $filesIterator = function (FolderInterface $folder, string $basePath = '') use (&$filesIterator) { |
|
142 | + $filesIterator = function(FolderInterface $folder, string $basePath = '') use (&$filesIterator) { |
|
143 | 143 | $files = []; |
144 | 144 | foreach ($folder->listing() as $node) { |
145 | 145 | if ($node->isFolder()) { |
@@ -237,7 +237,7 @@ |
||
237 | 237 | */ |
238 | 238 | private function log(string $message, int $level = ILogger::DEBUG) |
239 | 239 | { |
240 | - $this->logger->log($level, $message, [ 'app' => Application::APP_NAME ]); |
|
240 | + $this->logger->log($level, $message, ['app' => Application::APP_NAME]); |
|
241 | 241 | } |
242 | 242 | |
243 | 243 | /** |
@@ -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 | require($pluginFile); |
116 | 116 | }; |
117 | 117 | |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | throw new PluginNotCompatibleException( |
121 | 121 | $this->getName(), |
122 | 122 | 'Incompatible plugin: Plugin file "{file}" not found.', |
123 | - [ 'file' => $this->getName() . '/' . $this->getName() . '.php' ] |
|
123 | + ['file' => $this->getName() . '/' . $this->getName() . '.php'] |
|
124 | 124 | ); |
125 | 125 | } |
126 | 126 | |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | throw new PluginNotCompatibleException( |
132 | 132 | $this->getName(), |
133 | 133 | 'Incompatible plugin: Plugin class "{class}" not found.', |
134 | - [ 'class' => $className ] |
|
134 | + ['class' => $className] |
|
135 | 135 | ); |
136 | 136 | } |
137 | 137 | |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | $this->getName(), |
147 | 147 | 'Incompatible plugin: Plugins for Pico CMS for Nextcloud must use API version {minApiVersion} ' |
148 | 148 | . 'or later, but this plugin uses API version {apiVersion}.', |
149 | - [ 'minApiVersion' => \Pico::API_VERSION, 'apiVersion' => $apiVersion ] |
|
149 | + ['minApiVersion' => \Pico::API_VERSION, 'apiVersion' => $apiVersion] |
|
150 | 150 | ); |
151 | 151 | } |
152 | 152 |