@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | /** |
| 6 | 6 | * Balloon |
@@ -24,7 +24,7 @@ discard block |
||
| 24 | 24 | * |
| 25 | 25 | * @return stdClass |
| 26 | 26 | */ |
| 27 | - public static function DateTimeToUnix(?UTCDateTime $date): ?stdClass |
|
| 27 | + public static function DateTimeToUnix(?UTCDateTime $date) : ?stdClass |
|
| 28 | 28 | { |
| 29 | 29 | if (null === $date) { |
| 30 | 30 | return null; |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | */ |
| 88 | 88 | public static function isValidTimestamp(string $timestamp): bool |
| 89 | 89 | { |
| 90 | - return ((string) (int) $timestamp === $timestamp) |
|
| 90 | + return ((string)(int)$timestamp === $timestamp) |
|
| 91 | 91 | && ($timestamp <= PHP_INT_MAX) |
| 92 | 92 | && ($timestamp >= ~PHP_INT_MAX); |
| 93 | 93 | } |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | /** |
| 6 | 6 | * Balloon |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | ->prependRoute(new Route('/api/v1/file/convert', Convert::class)) |
| 37 | 37 | ->prependRoute(new Route('/api/v1/file/{id:#([0-9a-z]{24})#}/convert', Convert::class)); |
| 38 | 38 | |
| 39 | - $decorator->addDecorator('master', function ($node, $attributes) use ($fs, $decorator) { |
|
| 39 | + $decorator->addDecorator('master', function($node, $attributes) use ($fs, $decorator) { |
|
| 40 | 40 | $master = $node->getAppAttribute('Balloon\\App\\Convert', 'master'); |
| 41 | 41 | if (null === $master) { |
| 42 | 42 | return null; |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | /** |
| 6 | 6 | * Balloon |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | $body = []; |
| 113 | 113 | foreach ($this->notifier->getNotifications($this->user) as $message) { |
| 114 | 114 | $note = $message; |
| 115 | - $note['id'] = (string) $note['_id']; |
|
| 115 | + $note['id'] = (string)$note['_id']; |
|
| 116 | 116 | unset($note['_id'], $note['receiver']); |
| 117 | 117 | |
| 118 | 118 | $note['sender'] = $this->server->getUserById($note['sender'])->getAttribute([ |
@@ -251,7 +251,7 @@ discard block |
||
| 251 | 251 | $this->notifier->subscribe($this->fs->getNode($id, $p), $subscribe); |
| 252 | 252 | } catch (\Exception $e) { |
| 253 | 253 | $failures[] = [ |
| 254 | - 'id' => (string) $node->getId(), |
|
| 254 | + 'id' => (string)$node->getId(), |
|
| 255 | 255 | 'name' => $node->getName(), |
| 256 | 256 | 'error' => get_class($e), |
| 257 | 257 | 'message' => $e->getMessage(), |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | /** |
| 6 | 6 | * Balloon |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | /** |
| 38 | 38 | * {@inheritdoc} |
| 39 | 39 | */ |
| 40 | - public function notify(array $receiver, ?User $sender, string $subject, string $body, array $context = []): bool |
|
| 40 | + public function notify(array $receiver, ?User $sender, string $subject, string $body, array $context = []) : bool |
|
| 41 | 41 | { |
| 42 | 42 | $this->notifier->postNotification($receiver, $sender, $subject, $body, $context); |
| 43 | 43 | |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | /** |
| 6 | 6 | * Balloon |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | * |
| 95 | 95 | * @return AbstractHook |
| 96 | 96 | */ |
| 97 | - public function setOptions(?Iterable $config = null): self |
|
| 97 | + public function setOptions(?Iterable $config = null) : self |
|
| 98 | 98 | { |
| 99 | 99 | if (null === $config) { |
| 100 | 100 | return $this; |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | switch ($option) { |
| 105 | 105 | case 'body': |
| 106 | 106 | case 'subject': |
| 107 | - $this->{$option} = (string) $value; |
|
| 107 | + $this->{$option} = (string)$value; |
|
| 108 | 108 | |
| 109 | 109 | break; |
| 110 | 110 | default: |
@@ -134,7 +134,7 @@ discard block |
||
| 134 | 134 | /** |
| 135 | 135 | * {@inheritdoc} |
| 136 | 136 | */ |
| 137 | - public function postDeleteCollection(Collection $node, bool $force, ?string $recursion, bool $recursion_first): void |
|
| 137 | + public function postDeleteCollection(Collection $node, bool $force, ?string $recursion, bool $recursion_first) : void |
|
| 138 | 138 | { |
| 139 | 139 | $this->notify($node->getParent()); |
| 140 | 140 | } |
@@ -150,7 +150,7 @@ discard block |
||
| 150 | 150 | /** |
| 151 | 151 | * {@inheritdoc} |
| 152 | 152 | */ |
| 153 | - public function postDeleteFile(File $node, bool $force, ?string $recursion, bool $recursion_first): void |
|
| 153 | + public function postDeleteFile(File $node, bool $force, ?string $recursion, bool $recursion_first) : void |
|
| 154 | 154 | { |
| 155 | 155 | $this->notify($node->getParent()); |
| 156 | 156 | } |
@@ -171,7 +171,7 @@ discard block |
||
| 171 | 171 | protected function notify(Collection $collection): void |
| 172 | 172 | { |
| 173 | 173 | $subs = $collection->getAppAttribute('Balloon\\App\\Notification', 'subscription'); |
| 174 | - if (isset($subs[(string) $this->user->getId()])) { |
|
| 174 | + if (isset($subs[(string)$this->user->getId()])) { |
|
| 175 | 175 | $this->logger->info('user ['.$this->user->getId().'] got a subscription for node ['.$collection->getId().']', [ |
| 176 | 176 | 'category' => get_class($this), |
| 177 | 177 | ]); |
@@ -184,14 +184,14 @@ discard block |
||
| 184 | 184 | } |
| 185 | 185 | |
| 186 | 186 | $throttle = $collection->getAppAttribute('Balloon\\App\\Notification', 'notification_throttle'); |
| 187 | - if (is_array($throttle) && isset($throttle[(string) $collection->getId()])) { |
|
| 188 | - $last = $throttle[(string) $collection->getId()]; |
|
| 187 | + if (is_array($throttle) && isset($throttle[(string)$collection->getId()])) { |
|
| 188 | + $last = $throttle[(string)$collection->getId()]; |
|
| 189 | 189 | } |
| 190 | 190 | |
| 191 | - $body = preg_replace_callback('/(\{(([a-z]\.*)+)\})/', function ($match) use ($collection) { |
|
| 191 | + $body = preg_replace_callback('/(\{(([a-z]\.*)+)\})/', function($match) use ($collection) { |
|
| 192 | 192 | return $collection->getAttribute($match[2]); |
| 193 | 193 | }, $this->body); |
| 194 | - $subject = preg_replace_callback('/(\{(([a-z]\.*)+)\})/', function ($match) use ($collection) { |
|
| 194 | + $subject = preg_replace_callback('/(\{(([a-z]\.*)+)\})/', function($match) use ($collection) { |
|
| 195 | 195 | return $collection->getAttribute($match[2]); |
| 196 | 196 | }, $this->subject); |
| 197 | 197 | |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | /** |
| 6 | 6 | * Balloon |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | } |
| 69 | 69 | }); |
| 70 | 70 | |
| 71 | - $decorator->addDecorator('sharelink', function ($node, $attributes) use ($sharelink) { |
|
| 71 | + $decorator->addDecorator('sharelink', function($node, $attributes) use ($sharelink) { |
|
| 72 | 72 | return $sharelink->isSharelink($node); |
| 73 | 73 | }); |
| 74 | 74 | |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | if (isset($_GET['t']) && !empty($_GET['t'])) { |
| 87 | 87 | $token = $_GET['t']; |
| 88 | 88 | if (isset($_GET['download'])) { |
| 89 | - $download = (bool) $_GET['download']; |
|
| 89 | + $download = (bool)$_GET['download']; |
|
| 90 | 90 | } else { |
| 91 | 91 | $download = false; |
| 92 | 92 | } |