@@ -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 | /** |
@@ -297,6 +297,6 @@ |
||
| 297 | 297 | */ |
| 298 | 298 | public function getLinkMode(): int |
| 299 | 299 | { |
| 300 | - return (int) $this->configService->getAppValue(ConfigService::LINK_MODE); |
|
| 300 | + return (int)$this->configService->getAppValue(ConfigService::LINK_MODE); |
|
| 301 | 301 | } |
| 302 | 302 | } |