@@ -50,7 +50,7 @@ |
||
50 | 50 | $this->db->storage->updateOne( |
51 | 51 | ['_id' => $object['_id']], |
52 | 52 | [ |
53 | - '$set' => ['filter' => $filter], |
|
53 | + '$set' => ['filter' => $filter], |
|
54 | 54 | ] |
55 | 55 | ); |
56 | 56 | } |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | /** |
6 | 6 | * balloon |
@@ -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 |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | throw new Exception('soffice option must be a path to an executable office suite'); |
156 | 156 | } |
157 | 157 | |
158 | - $this->soffice = (string) $value; |
|
158 | + $this->soffice = (string)$value; |
|
159 | 159 | |
160 | 160 | break; |
161 | 161 | case 'tmp': |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | throw new Exception('tmp option must be a writable directory'); |
164 | 164 | } |
165 | 165 | |
166 | - $this->tmp = (string) $value; |
|
166 | + $this->tmp = (string)$value; |
|
167 | 167 | |
168 | 168 | break; |
169 | 169 | case 'timeout': |
@@ -171,11 +171,11 @@ discard block |
||
171 | 171 | throw new Exception('timeout option must be a number'); |
172 | 172 | } |
173 | 173 | |
174 | - $this->timeout = (string) $value; |
|
174 | + $this->timeout = (string)$value; |
|
175 | 175 | |
176 | 176 | break; |
177 | 177 | case 'preview_max_size': |
178 | - $this->preview_max_size = (int) $value; |
|
178 | + $this->preview_max_size = (int)$value; |
|
179 | 179 | |
180 | 180 | break; |
181 | 181 | default: |
@@ -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 | foreach ($config as $option => $value) { |
95 | 95 | switch ($option) { |
96 | 96 | case 'preview_max_size': |
97 | - $this->preview_max_size = (int) $value; |
|
97 | + $this->preview_max_size = (int)$value; |
|
98 | 98 | |
99 | 99 | break; |
100 | 100 | default: |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | */ |
111 | 111 | public function match(File $file): bool |
112 | 112 | { |
113 | - return (bool) preg_match($this->match_convert, $file->getContentType()); |
|
113 | + return (bool)preg_match($this->match_convert, $file->getContentType()); |
|
114 | 114 | } |
115 | 115 | |
116 | 116 | /** |
@@ -107,7 +107,7 @@ |
||
107 | 107 | * |
108 | 108 | * @param string $id |
109 | 109 | * @param string $p |
110 | - * @param string $version |
|
110 | + * @param integer $version |
|
111 | 111 | * |
112 | 112 | * @return Response |
113 | 113 | */ |
@@ -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 |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | $body = []; |
84 | 84 | |
85 | 85 | foreach ($result as $version) { |
86 | - $v = (array) $version; |
|
86 | + $v = (array)$version; |
|
87 | 87 | |
88 | 88 | $v['user'] = $this->server->getUserById($version['user'])->getUsername(); |
89 | 89 | $v['changed'] = Helper::DateTimeToUnix($version['changed']); |
@@ -306,7 +306,7 @@ discard block |
||
306 | 306 | $wrote = fwrite($chunkgroup_handler, $data); |
307 | 307 | $tmp_size += $wrote; |
308 | 308 | |
309 | - if ($tmp_size > (int) $this->server->getMaxFileSize()) { |
|
309 | + if ($tmp_size > (int)$this->server->getMaxFileSize()) { |
|
310 | 310 | fclose($input_handler); |
311 | 311 | fclose($chunkgroup_handler); |
312 | 312 | unlink($file); |
@@ -523,7 +523,7 @@ discard block |
||
523 | 523 | |
524 | 524 | return (new Response())->setCode(201)->setBody([ |
525 | 525 | 'code' => 201, |
526 | - 'data' => (string) $result, |
|
526 | + 'data' => (string)$result, |
|
527 | 527 | ]); |
528 | 528 | } |
529 | 529 | } catch (ForbiddenException $e) { |
@@ -551,7 +551,7 @@ discard block |
||
551 | 551 | |
552 | 552 | return (new Response())->setCode(201)->setBody([ |
553 | 553 | 'code' => 201, |
554 | - 'data' => (string) $result, |
|
554 | + 'data' => (string)$result, |
|
555 | 555 | ]); |
556 | 556 | } catch (Exception\NotFound $e) { |
557 | 557 | throw new Exception('parent collection '.$parent_path.' was not found'); |
@@ -282,7 +282,7 @@ discard block |
||
282 | 282 | * @param array|string $id |
283 | 283 | * @param array|string $p |
284 | 284 | * @param int $offset |
285 | - * @param int $legnth |
|
285 | + * @param int $length |
|
286 | 286 | * @param string $encode |
287 | 287 | * @param bool $download |
288 | 288 | * @param string $name |
@@ -1420,7 +1420,7 @@ discard block |
||
1420 | 1420 | * @param string $class Force set node type |
1421 | 1421 | * @param bool $multiple Allow $id to be an array |
1422 | 1422 | * @param bool $allow_root Allow instance of root collection |
1423 | - * @param bool $deleted How to handle deleted node |
|
1423 | + * @param integer $deleted How to handle deleted node |
|
1424 | 1424 | * |
1425 | 1425 | * @return NodeInterface |
1426 | 1426 | */ |
@@ -1454,7 +1454,7 @@ discard block |
||
1454 | 1454 | * @param string $id |
1455 | 1455 | * @param string $path |
1456 | 1456 | * @param string $class Force set node type |
1457 | - * @param bool $deleted How to handle deleted node |
|
1457 | + * @param integer $deleted How to handle deleted node |
|
1458 | 1458 | * |
1459 | 1459 | * @return Generator |
1460 | 1460 | */ |
@@ -320,50 +320,50 @@ discard block |
||
320 | 320 | } |
321 | 321 | |
322 | 322 | return (new Response()) |
323 | - ->setOutputFormat(null) |
|
324 | - ->setBody(function () use ($node, $encode, $offset, $length) { |
|
325 | - $mime = $node->getContentType(); |
|
326 | - $stream = $node->get(); |
|
327 | - $name = $node->getName(); |
|
328 | - |
|
329 | - if (null === $stream) { |
|
330 | - return; |
|
331 | - } |
|
332 | - |
|
333 | - if (0 !== $offset) { |
|
334 | - if (fseek($stream, $offset) === -1) { |
|
335 | - throw new Exception\Conflict( |
|
323 | + ->setOutputFormat(null) |
|
324 | + ->setBody(function () use ($node, $encode, $offset, $length) { |
|
325 | + $mime = $node->getContentType(); |
|
326 | + $stream = $node->get(); |
|
327 | + $name = $node->getName(); |
|
328 | + |
|
329 | + if (null === $stream) { |
|
330 | + return; |
|
331 | + } |
|
332 | + |
|
333 | + if (0 !== $offset) { |
|
334 | + if (fseek($stream, $offset) === -1) { |
|
335 | + throw new Exception\Conflict( |
|
336 | 336 | 'invalid offset requested', |
337 | 337 | Exception\Conflict::INVALID_OFFSET |
338 | 338 | ); |
339 | - } |
|
340 | - } |
|
341 | - |
|
342 | - $read = 0; |
|
343 | - header('Content-Type: '.$mime.''); |
|
344 | - if ('base64' === $encode) { |
|
345 | - header('Content-Encoding: base64'); |
|
346 | - while (!feof($stream)) { |
|
347 | - if (0 !== $length && $read + 8192 > $length) { |
|
348 | - echo base64_encode(fread($stream, $length - $read)); |
|
349 | - exit(); |
|
350 | - } |
|
351 | - |
|
352 | - echo base64_encode(fread($stream, 8192)); |
|
353 | - $read += 8192; |
|
354 | - } |
|
355 | - } else { |
|
356 | - while (!feof($stream)) { |
|
357 | - if (0 !== $length && $read + 8192 > $length) { |
|
358 | - echo fread($stream, $length - $read); |
|
359 | - exit(); |
|
360 | - } |
|
361 | - |
|
362 | - echo fread($stream, 8192); |
|
363 | - $read += 8192; |
|
364 | - } |
|
365 | - } |
|
366 | - }); |
|
339 | + } |
|
340 | + } |
|
341 | + |
|
342 | + $read = 0; |
|
343 | + header('Content-Type: '.$mime.''); |
|
344 | + if ('base64' === $encode) { |
|
345 | + header('Content-Encoding: base64'); |
|
346 | + while (!feof($stream)) { |
|
347 | + if (0 !== $length && $read + 8192 > $length) { |
|
348 | + echo base64_encode(fread($stream, $length - $read)); |
|
349 | + exit(); |
|
350 | + } |
|
351 | + |
|
352 | + echo base64_encode(fread($stream, 8192)); |
|
353 | + $read += 8192; |
|
354 | + } |
|
355 | + } else { |
|
356 | + while (!feof($stream)) { |
|
357 | + if (0 !== $length && $read + 8192 > $length) { |
|
358 | + echo fread($stream, $length - $read); |
|
359 | + exit(); |
|
360 | + } |
|
361 | + |
|
362 | + echo fread($stream, 8192); |
|
363 | + $read += 8192; |
|
364 | + } |
|
365 | + } |
|
366 | + }); |
|
367 | 367 | } |
368 | 368 | |
369 | 369 | /** |
@@ -1502,9 +1502,9 @@ discard block |
||
1502 | 1502 | $node->zip($archive); |
1503 | 1503 | } catch (\Exception $e) { |
1504 | 1504 | $this->logger->debug('failed zip node in multi node request ['.$node->getId().']', [ |
1505 | - 'category' => get_class($this), |
|
1506 | - 'exception' => $e, |
|
1507 | - ]); |
|
1505 | + 'category' => get_class($this), |
|
1506 | + 'exception' => $e, |
|
1507 | + ]); |
|
1508 | 1508 | } |
1509 | 1509 | } |
1510 | 1510 |
@@ -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 |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | $result = $this->_getNode($id, $p, null, false, false, $deleted); |
124 | 124 | |
125 | 125 | $response = (new Response()) |
126 | - ->setHeader('Content-Length', (string) $result->getSize()) |
|
126 | + ->setHeader('Content-Length', (string)$result->getSize()) |
|
127 | 127 | ->setHeader('Content-Type', $result->getContentType()) |
128 | 128 | ->setCode(200); |
129 | 129 | |
@@ -192,7 +192,7 @@ discard block |
||
192 | 192 | } |
193 | 193 | } |
194 | 194 | |
195 | - return $this->bulk($id, $p, function ($node) use ($parent, $conflict, $move) { |
|
195 | + return $this->bulk($id, $p, function($node) use ($parent, $conflict, $move) { |
|
196 | 196 | if (true === $move) { |
197 | 197 | $node = $node->setParent($parent, $conflict); |
198 | 198 | } |
@@ -273,7 +273,7 @@ discard block |
||
273 | 273 | |
274 | 274 | $node = $this->_getNode($id, $p); |
275 | 275 | if ($node instanceof Collection) { |
276 | - return (new Response())->setBody(function () use ($node) { |
|
276 | + return (new Response())->setBody(function() use ($node) { |
|
277 | 277 | $node->getZip(); |
278 | 278 | }); |
279 | 279 | } |
@@ -284,7 +284,7 @@ discard block |
||
284 | 284 | $response->setHeader('Content-Disposition', 'attachment; filename*=UTF-8\'\''.rawurlencode($name)); |
285 | 285 | $response->setHeader('Cache-Control', 'no-store, no-cache, must-revalidate, post-check=0, pre-check=0'); |
286 | 286 | $response->setHeader('Content-Type', 'application/octet-stream'); |
287 | - $response->setHeader('Content-Length', (string) $node->getSize()); |
|
287 | + $response->setHeader('Content-Length', (string)$node->getSize()); |
|
288 | 288 | $response->setHeader('Content-Transfer-Encoding', 'binary'); |
289 | 289 | } else { |
290 | 290 | $response->setHeader('Content-Disposition', 'inline; filename*=UTF-8\'\''.rawurlencode($name)); |
@@ -292,7 +292,7 @@ discard block |
||
292 | 292 | |
293 | 293 | return (new Response()) |
294 | 294 | ->setOutputFormat(null) |
295 | - ->setBody(function () use ($node, $encode, $offset, $length) { |
|
295 | + ->setBody(function() use ($node, $encode, $offset, $length) { |
|
296 | 296 | $mime = $node->getContentType(); |
297 | 297 | $stream = $node->get(); |
298 | 298 | $name = $node->getName(); |
@@ -365,7 +365,7 @@ discard block |
||
365 | 365 | */ |
366 | 366 | public function postReadonly($id = null, $p = null, bool $readonly = true): Response |
367 | 367 | { |
368 | - return $this->bulk($id, $p, function ($node) use ($readonly) { |
|
368 | + return $this->bulk($id, $p, function($node) use ($readonly) { |
|
369 | 369 | $node->setReadonly($readonly); |
370 | 370 | |
371 | 371 | return ['code' => 204]; |
@@ -618,7 +618,7 @@ discard block |
||
618 | 618 | */ |
619 | 619 | public function postMetaAttributes(?string $id = null, ?string $p = null): Response |
620 | 620 | { |
621 | - return $this->bulk($id, $p, function ($node) { |
|
621 | + return $this->bulk($id, $p, function($node) { |
|
622 | 622 | $node->setMetaAttributes($_POST); |
623 | 623 | |
624 | 624 | return ['code' => 204]; |
@@ -706,7 +706,7 @@ discard block |
||
706 | 706 | ); |
707 | 707 | } |
708 | 708 | |
709 | - return $this->bulk($id, $p, function ($node) use ($parent, $conflict) { |
|
709 | + return $this->bulk($id, $p, function($node) use ($parent, $conflict) { |
|
710 | 710 | $result = $node->copyTo($parent, $conflict); |
711 | 711 | |
712 | 712 | return [ |
@@ -770,7 +770,7 @@ discard block |
||
770 | 770 | ); |
771 | 771 | } |
772 | 772 | |
773 | - return $this->bulk($id, $p, function ($node) use ($parent, $conflict) { |
|
773 | + return $this->bulk($id, $p, function($node) use ($parent, $conflict) { |
|
774 | 774 | $result = $node->setParent($parent, $conflict); |
775 | 775 | if (NodeInterface::CONFLICT_RENAME === $conflict) { |
776 | 776 | return [ |
@@ -829,7 +829,7 @@ discard block |
||
829 | 829 | $at = $this->_verifyAttributes(['destroy' => $at])['destroy']; |
830 | 830 | } |
831 | 831 | |
832 | - return $this->bulk($id, $p, function ($node) use ($force, $ignore_flag, $at) { |
|
832 | + return $this->bulk($id, $p, function($node) use ($force, $ignore_flag, $at) { |
|
833 | 833 | if (null === $at) { |
834 | 834 | $node->delete($force && $node->isDeleted() || $force && $ignore_flag); |
835 | 835 | } else { |
@@ -1428,7 +1428,7 @@ discard block |
||
1428 | 1428 | foreach ($attributes as $attribute => $value) { |
1429 | 1429 | switch ($attribute) { |
1430 | 1430 | case 'filter': |
1431 | - $attributes['filter'] = json_encode((array) $attributes['filter']); |
|
1431 | + $attributes['filter'] = json_encode((array)$attributes['filter']); |
|
1432 | 1432 | |
1433 | 1433 | break; |
1434 | 1434 | case 'destroy': |
@@ -1443,14 +1443,14 @@ discard block |
||
1443 | 1443 | if (!Helper::isValidTimestamp($value)) { |
1444 | 1444 | throw new Exception\InvalidArgument($attribute.' Changed timestamp must be valid unix timestamp'); |
1445 | 1445 | } |
1446 | - if ((int) $value > time()) { |
|
1446 | + if ((int)$value > time()) { |
|
1447 | 1447 | throw new Exception\InvalidArgument($attribute.' timestamp can not be set greater than the server time'); |
1448 | 1448 | } |
1449 | 1449 | $attributes[$attribute] = new UTCDateTime($value.'000'); |
1450 | 1450 | |
1451 | 1451 | break; |
1452 | 1452 | case 'readonly': |
1453 | - $attributes['readonly'] = (bool) $attributes['readonly']; |
|
1453 | + $attributes['readonly'] = (bool)$attributes['readonly']; |
|
1454 | 1454 | |
1455 | 1455 | break; |
1456 | 1456 | } |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | /** |
56 | 56 | * Constructor. |
57 | 57 | * |
58 | - * @param Notification $notifier |
|
58 | + * @param Notifier $notifier |
|
59 | 59 | * @param Server $server |
60 | 60 | */ |
61 | 61 | public function __construct(Notifier $notifier, Server $server, LoggerInterface $logger, TemplateHandler $template) |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | * @param NodeInterface $node |
130 | 130 | * @param User $user |
131 | 131 | * |
132 | - * @return string |
|
132 | + * @return boolean |
|
133 | 133 | */ |
134 | 134 | protected function checkNotify(NodeInterface $node, User $user): bool |
135 | 135 | { |
@@ -14,7 +14,6 @@ |
||
14 | 14 | use Balloon\App\Notification\NodeMessage; |
15 | 15 | use Balloon\App\Notification\Notifier; |
16 | 16 | use Balloon\App\Notification\TemplateHandler; |
17 | -use Balloon\Async\Mail; |
|
18 | 17 | use Balloon\Filesystem\Node\Collection; |
19 | 18 | use Balloon\Filesystem\Node\NodeInterface; |
20 | 19 | use Balloon\Hook\AbstractHook; |
@@ -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 |
@@ -105,13 +105,13 @@ discard block |
||
105 | 105 | $receiver = []; |
106 | 106 | foreach ($node->getAcl() as $rule) { |
107 | 107 | if ('user' === $rule['type']) { |
108 | - if (!isset($receiver[(string) $rule['role']->getId()]) && $this->checkNotify($node, $rule['role'])) { |
|
109 | - $receiver[(string) $rule['role']->getId()] = $rule['role']; |
|
108 | + if (!isset($receiver[(string)$rule['role']->getId()]) && $this->checkNotify($node, $rule['role'])) { |
|
109 | + $receiver[(string)$rule['role']->getId()] = $rule['role']; |
|
110 | 110 | } |
111 | 111 | } elseif ('group' === $rule['type']) { |
112 | 112 | foreach ($rule['role']->getResolvedMembers() as $user) { |
113 | - if (!isset($receiver[(string) $user->getId()]) && $this->checkNotify($node, $user)) { |
|
114 | - $receiver[(string) $user->getId()] = $user; |
|
113 | + if (!isset($receiver[(string)$user->getId()]) && $this->checkNotify($node, $user)) { |
|
114 | + $receiver[(string)$user->getId()] = $user; |
|
115 | 115 | } |
116 | 116 | } |
117 | 117 | } |
@@ -64,7 +64,7 @@ |
||
64 | 64 | /** |
65 | 65 | * Constructor. |
66 | 66 | * |
67 | - * @param Notification $notifier |
|
67 | + * @param Notifier $notifier |
|
68 | 68 | * @param Server $server |
69 | 69 | */ |
70 | 70 | public function __construct(Notifier $notifier, Server $server, TemplateHandler $template, LoggerInterface $logger, ?Iterable $config = 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 |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | foreach ($config as $option => $value) { |
93 | 93 | switch ($option) { |
94 | 94 | case 'notification_throttle': |
95 | - $this->{$option} = (int) $value; |
|
95 | + $this->{$option} = (int)$value; |
|
96 | 96 | |
97 | 97 | break; |
98 | 98 | default: |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | public function postCreateCollection(Collection $parent, Collection $node, bool $clone): void |
110 | 110 | { |
111 | 111 | $this->notify($node); |
112 | - $user_id = (string) $this->server->getIdentity()->getId(); |
|
112 | + $user_id = (string)$this->server->getIdentity()->getId(); |
|
113 | 113 | $subs = $parent->getAppAttribute('Balloon\\App\\Notification', 'subscription'); |
114 | 114 | |
115 | 115 | if (isset($subs[$user_id]) && $subs[$user_id]['recursive'] === true) { |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | $parent = $node->getParent(); |
172 | 172 | |
173 | 173 | if ($parent !== null) { |
174 | - $subs = array_keys((array) $parent->getAppAttribute('Balloon\\App\\Notification', 'subscription')); |
|
174 | + $subs = array_keys((array)$parent->getAppAttribute('Balloon\\App\\Notification', 'subscription')); |
|
175 | 175 | $parents = $this->getReceiver($parent); |
176 | 176 | |
177 | 177 | $blacklist = array_diff($subs, $parents); |
@@ -223,7 +223,7 @@ discard block |
||
223 | 223 | $node->setAppAttribute('Balloon\\App\\Notification', 'subscription', $update); |
224 | 224 | |
225 | 225 | if ($this->server->getIdentity() !== null) { |
226 | - $user_id = (string) $this->server->getIdentity()->getId(); |
|
226 | + $user_id = (string)$this->server->getIdentity()->getId(); |
|
227 | 227 | if (isset($subs[$user_id]) && $subs[$user_id]['exclude_me'] === true) { |
228 | 228 | $this->logger->debug('skip message for user ['.$user_id.'], user excludes own actions in node ['.$node->getId().']', [ |
229 | 229 | 'category' => get_class($this), |
@@ -19,7 +19,6 @@ |
||
19 | 19 | use Balloon\Filesystem\Node\NodeInterface; |
20 | 20 | use Balloon\Hook\AbstractHook; |
21 | 21 | use Balloon\Server; |
22 | -use Balloon\Server\User; |
|
23 | 22 | use InvalidArgumentException; |
24 | 23 | use MongoDB\BSON\UTCDateTime; |
25 | 24 | use Psr\Log\LoggerInterface; |
@@ -218,8 +218,6 @@ discard block |
||
218 | 218 | /** |
219 | 219 | * Replace variables. |
220 | 220 | * |
221 | - * @param string $type |
|
222 | - * @param User $user |
|
223 | 221 | */ |
224 | 222 | protected function decorate(string $template): string |
225 | 223 | { |
@@ -229,8 +227,6 @@ discard block |
||
229 | 227 | /** |
230 | 228 | * Replace variables. |
231 | 229 | * |
232 | - * @param string $type |
|
233 | - * @param User $user |
|
234 | 230 | */ |
235 | 231 | protected function decorateNode(string $template, NodeInterface $node): string |
236 | 232 | { |
@@ -248,7 +244,6 @@ discard block |
||
248 | 244 | /** |
249 | 245 | * Replace variables. |
250 | 246 | * |
251 | - * @param string $type |
|
252 | 247 | * @param User $user |
253 | 248 | */ |
254 | 249 | protected function decorateUser(string $template, User $user): string |
@@ -267,9 +262,9 @@ discard block |
||
267 | 262 | /** |
268 | 263 | * Get array value via string path. |
269 | 264 | * |
270 | - * @param iterable $arr |
|
265 | + * @param iterable $array |
|
271 | 266 | * @param string $path |
272 | - * @param string $seperator |
|
267 | + * @param string $separator |
|
273 | 268 | * |
274 | 269 | * @return mixed |
275 | 270 | */ |
@@ -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 |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | switch ($option) { |
121 | 121 | case 'asset_dir': |
122 | 122 | case 'fallback_locale': |
123 | - $this->{$option} = (string) $value; |
|
123 | + $this->{$option} = (string)$value; |
|
124 | 124 | |
125 | 125 | break; |
126 | 126 | default: |
@@ -236,7 +236,7 @@ discard block |
||
236 | 236 | { |
237 | 237 | $decorator = $this->decorator; |
238 | 238 | |
239 | - return preg_replace_callback('/(\{node\.(([a-z]\.*)+)\})/', function ($match) use ($node, $decorator) { |
|
239 | + return preg_replace_callback('/(\{node\.(([a-z]\.*)+)\})/', function($match) use ($node, $decorator) { |
|
240 | 240 | $key = explode('.', $match[2]); |
241 | 241 | $key = array_shift($key); |
242 | 242 | $attrs = $decorator->decorate($node, [$key]); |
@@ -255,7 +255,7 @@ discard block |
||
255 | 255 | { |
256 | 256 | $role_decorator = $this->role_decorator; |
257 | 257 | |
258 | - return preg_replace_callback('/(\{user\.(([a-z]\.*)+)\})/', function ($match) use ($user, $role_decorator) { |
|
258 | + return preg_replace_callback('/(\{user\.(([a-z]\.*)+)\})/', function($match) use ($user, $role_decorator) { |
|
259 | 259 | $key = explode('.', $match[2]); |
260 | 260 | $key = array_shift($key); |
261 | 261 | $attrs = $role_decorator->decorate($user, [$key]); |
@@ -11,7 +11,6 @@ |
||
11 | 11 | |
12 | 12 | namespace Balloon\Bootstrap; |
13 | 13 | |
14 | -use Balloon\App; |
|
15 | 14 | use Composer\Autoload\ClassLoader as Composer; |
16 | 15 | use ErrorException; |
17 | 16 | use Micro\Container\Container; |
@@ -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 |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | protected function registerAppConstructors(array $apps): self |
66 | 66 | { |
67 | 67 | $context = $this->getContext(); |
68 | - $app_config = (array) $this->config['apps']; |
|
68 | + $app_config = (array)$this->config['apps']; |
|
69 | 69 | |
70 | 70 | foreach ($apps as $app) { |
71 | 71 | if (isset($app_config[$app])) { |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | protected function loadAppConfigs(array $apps, Config $config) |
103 | 103 | { |
104 | 104 | $root = new Config(__DIR__.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'.container.config.php'); |
105 | - $app_config = (array) $config['apps']; |
|
105 | + $app_config = (array)$config['apps']; |
|
106 | 106 | $configs = []; |
107 | 107 | |
108 | 108 | foreach ($apps as $name => $config_path) { |
@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | */ |
183 | 183 | protected function setErrorHandler(): self |
184 | 184 | { |
185 | - set_error_handler(function ($severity, $message, $file, $line) { |
|
185 | + set_error_handler(function($severity, $message, $file, $line) { |
|
186 | 186 | $log = $message.' in '.$file.':'.$line; |
187 | 187 | |
188 | 188 | if (null === $this->container) { |