@@ -45,7 +45,6 @@ |
||
45 | 45 | /** |
46 | 46 | * Init queue |
47 | 47 | * |
48 | - * @param Filesystem $fs |
|
49 | 48 | * @param Logger $logger |
50 | 49 | * @param Config $config |
51 | 50 | * @return void |
@@ -1,5 +1,5 @@ |
||
1 | 1 | <?php |
2 | -declare(strict_types=1); |
|
2 | +declare(strict_types = 1); |
|
3 | 3 | |
4 | 4 | /** |
5 | 5 | * Balloon |
@@ -29,7 +29,7 @@ |
||
29 | 29 | * Create thumbnail job |
30 | 30 | * |
31 | 31 | * @param array $data |
32 | - * @return void |
|
32 | + * @return JobInterface |
|
33 | 33 | */ |
34 | 34 | public function __construct(array $data) |
35 | 35 | { |
@@ -12,7 +12,6 @@ |
||
12 | 12 | namespace Balloon\Queue; |
13 | 13 | |
14 | 14 | use \Psr\Log\LoggerInterface as Logger; |
15 | -use Balloon\Config; |
|
16 | 15 | use \MongoDB\Database; |
17 | 16 | |
18 | 17 | abstract class AbstractJob implements JobInterface |
@@ -1,5 +1,5 @@ |
||
1 | 1 | <?php |
2 | -declare(strict_types=1); |
|
2 | +declare(strict_types = 1); |
|
3 | 3 | |
4 | 4 | /** |
5 | 5 | * Balloon |
@@ -21,7 +21,6 @@ |
||
21 | 21 | /** |
22 | 22 | * Run job |
23 | 23 | * |
24 | - * @param Filesystem $fs |
|
25 | 24 | * @return bool |
26 | 25 | */ |
27 | 26 | public function getData(): array; |
@@ -1,5 +1,5 @@ |
||
1 | 1 | <?php |
2 | -declare(strict_types=1); |
|
2 | +declare(strict_types = 1); |
|
3 | 3 | |
4 | 4 | /** |
5 | 5 | * Balloon |
@@ -31,7 +31,7 @@ |
||
31 | 31 | * Set options |
32 | 32 | * |
33 | 33 | * @param Config $config |
34 | - * @return MailNotification |
|
34 | + * @return Mail |
|
35 | 35 | */ |
36 | 36 | public function setOptions(Config $config): Mail |
37 | 37 | { |
@@ -1,5 +1,5 @@ |
||
1 | 1 | <?php |
2 | -declare(strict_types=1); |
|
2 | +declare(strict_types = 1); |
|
3 | 3 | |
4 | 4 | /** |
5 | 5 | * Balloon |
@@ -20,14 +20,9 @@ discard block |
||
20 | 20 | /** |
21 | 21 | * Load user object with name or with id |
22 | 22 | * |
23 | - * @param string|\MongoDB\BSON\ObjectID|Auth $user |
|
24 | - * @param \MongoDB\Database $db |
|
23 | + * @param User $user |
|
25 | 24 | * @param Logger $logger |
26 | - * @param Config $config |
|
27 | - * @param Plugin $plugin |
|
28 | - * @param bool $autocreate |
|
29 | - * @param bool $ignore_deleted |
|
30 | - * @return void |
|
25 | + * @return boolean|string |
|
31 | 26 | */ |
32 | 27 | public function __construct(User $user, Logger $logger, Filesystem $fs) |
33 | 28 | { |
@@ -56,8 +51,6 @@ discard block |
||
56 | 51 | /** |
57 | 52 | * Sync user |
58 | 53 | * |
59 | - * @param string $q |
|
60 | - * @param bool $single |
|
61 | 54 | * @return array |
62 | 55 | */ |
63 | 56 | public function getUsersByGroup(string $group): array |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -declare(strict_types=1); |
|
2 | +declare(strict_types = 1); |
|
3 | 3 | |
4 | 4 | /** |
5 | 5 | * Balloon |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | * @param bool $ignore_namespace |
88 | 88 | * @return array |
89 | 89 | */ |
90 | - public function searchUser(string $q, bool $single=false, bool $ignore_namespace=false): array |
|
90 | + public function searchUser(string $q, bool $single = false, bool $ignore_namespace = false): array |
|
91 | 91 | { |
92 | 92 | if (empty($q)) { |
93 | 93 | return []; |
@@ -122,10 +122,10 @@ discard block |
||
122 | 122 | } else { |
123 | 123 | $ns = $this->user->getAttribute('namespace'); |
124 | 124 | $filter = htmlspecialchars_decode(sprintf($searchu['filter'], $q)); |
125 | - $base = sprintf($config['basedn'], $ns); |
|
125 | + $base = sprintf($config['basedn'], $ns); |
|
126 | 126 | } |
127 | 127 | |
128 | - $result_user = ldap_search($ldap, $base, $filter, [ |
|
128 | + $result_user = ldap_search($ldap, $base, $filter, [ |
|
129 | 129 | $searchu['display_attr'], |
130 | 130 | $searchu['id_attr'], |
131 | 131 | ]); |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | * @param bool $single |
179 | 179 | * @return array |
180 | 180 | */ |
181 | - public function searchGroup(string $q, bool $single=false): array |
|
181 | + public function searchGroup(string $q, bool $single = false): array |
|
182 | 182 | { |
183 | 183 | if (empty($q)) { |
184 | 184 | return []; |
@@ -200,10 +200,10 @@ discard block |
||
200 | 200 | } else { |
201 | 201 | $ns = $this->user->getAttribute('namespace'); |
202 | 202 | $filter = htmlspecialchars_decode(sprintf($searchg['filter'], $q)); |
203 | - $base = sprintf($config['basedn'], $ns); |
|
203 | + $base = sprintf($config['basedn'], $ns); |
|
204 | 204 | } |
205 | 205 | |
206 | - $result_group = ldap_search($ldap, $base, $filter, [ |
|
206 | + $result_group = ldap_search($ldap, $base, $filter, [ |
|
207 | 207 | $searchg['display_attr'], |
208 | 208 | $searchg['id_attr'], |
209 | 209 | ]); |
@@ -158,7 +158,7 @@ |
||
158 | 158 | * |
159 | 159 | * @param string $id |
160 | 160 | * @param string $p |
161 | - * @param string $version |
|
161 | + * @param integer $version |
|
162 | 162 | * @return Response |
163 | 163 | */ |
164 | 164 | public function postRestore(int $version, ?string $id=null, ?string $p=null): Response |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -declare(strict_types=1); |
|
2 | +declare(strict_types = 1); |
|
3 | 3 | |
4 | 4 | /** |
5 | 5 | * Balloon |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | * @param string $encode |
56 | 56 | * @return void |
57 | 57 | */ |
58 | - public function getPreview(?string $id=null, ?string $p=null, ?string $encode=null): void |
|
58 | + public function getPreview(?string $id = null, ?string $p = null, ?string $encode = null) : void |
|
59 | 59 | { |
60 | 60 | $node = $this->_getNode($id, $p); |
61 | 61 | $data = $node->getPreview(); |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | * @param string $p |
129 | 129 | * @return Response |
130 | 130 | */ |
131 | - public function getHistory(?string $id=null, ?string $p=null): Response |
|
131 | + public function getHistory(?string $id = null, ?string $p = null) : Response |
|
132 | 132 | { |
133 | 133 | $result = Helper::escape( |
134 | 134 | $this->_getNode($id, $p)->getHistory() |
@@ -161,7 +161,7 @@ discard block |
||
161 | 161 | * @param string $version |
162 | 162 | * @return Response |
163 | 163 | */ |
164 | - public function postRestore(int $version, ?string $id=null, ?string $p=null): Response |
|
164 | + public function postRestore(int $version, ?string $id = null, ?string $p = null) : Response |
|
165 | 165 | { |
166 | 166 | $result = $this->_getNode($id, $p)->restore($version); |
167 | 167 | return (new Response())->setCode(204); |
@@ -297,15 +297,15 @@ discard block |
||
297 | 297 | */ |
298 | 298 | public function putChunk( |
299 | 299 | string $chunkgroup, |
300 | - ?string $id=null, |
|
301 | - ?string $p=null, |
|
302 | - ?string $collection=null, |
|
303 | - ?string $name=null, |
|
304 | - int $index=1, |
|
305 | - int $chunks=0, |
|
306 | - int $size=0, |
|
307 | - array $attributes=[], |
|
308 | - int $conflict=0) |
|
300 | + ?string $id = null, |
|
301 | + ?string $p = null, |
|
302 | + ?string $collection = null, |
|
303 | + ?string $name = null, |
|
304 | + int $index = 1, |
|
305 | + int $chunks = 0, |
|
306 | + int $size = 0, |
|
307 | + array $attributes = [], |
|
308 | + int $conflict = 0) |
|
309 | 309 | { |
310 | 310 | ini_set('auto_detect_line_endings', '1'); |
311 | 311 | $input_handler = fopen('php://input', 'rb'); |
@@ -464,12 +464,12 @@ discard block |
||
464 | 464 | * @return Response |
465 | 465 | */ |
466 | 466 | public function put( |
467 | - ?string $id=null, |
|
468 | - ?string $p=null, |
|
469 | - ?string $collection=null, |
|
470 | - ?string $name=null, |
|
471 | - array $attributes=[], |
|
472 | - int $conflict=0): Response |
|
467 | + ?string $id = null, |
|
468 | + ?string $p = null, |
|
469 | + ?string $collection = null, |
|
470 | + ?string $name = null, |
|
471 | + array $attributes = [], |
|
472 | + int $conflict = 0) : Response |
|
473 | 473 | { |
474 | 474 | $attributes = $this->_verifyAttributes($attributes); |
475 | 475 | |
@@ -493,12 +493,12 @@ discard block |
||
493 | 493 | */ |
494 | 494 | protected function _put( |
495 | 495 | $content, |
496 | - ?string $id=null, |
|
497 | - ?string $p=null, |
|
498 | - ?string $collection=null, |
|
499 | - ?string $name=null, |
|
500 | - array $attributes=[], |
|
501 | - int $conflict=0): Response |
|
496 | + ?string $id = null, |
|
497 | + ?string $p = null, |
|
498 | + ?string $collection = null, |
|
499 | + ?string $name = null, |
|
500 | + array $attributes = [], |
|
501 | + int $conflict = 0) : Response |
|
502 | 502 | { |
503 | 503 | if ($id === null && $p === null && $name === null) { |
504 | 504 | throw new Exception\InvalidArgument('neither id, p nor name was set'); |
@@ -518,7 +518,7 @@ discard block |
||
518 | 518 | $result = $node->put($content, false, $attributes); |
519 | 519 | return (new Response())->setCode(200)->setBody($result); |
520 | 520 | } elseif ($p === null && $id === null && $name !== null) { |
521 | - $collection = $this->_getNode($collection, null, 'Collection', false, true); |
|
521 | + $collection = $this->_getNode($collection, null, 'Collection', false, true); |
|
522 | 522 | |
523 | 523 | if ($collection->childExists($name)) { |
524 | 524 | $child = $collection->getChild($name); |
@@ -534,7 +534,7 @@ discard block |
||
534 | 534 | return (new Response())->setCode(201)->setBody($result); |
535 | 535 | } |
536 | 536 | } |
537 | - } catch(Exception\Forbidden $e) { |
|
537 | + } catch (Exception\Forbidden $e) { |
|
538 | 538 | throw new Exception\Conflict('a node called '.$name.' does already exists in this collection', |
539 | 539 | Exception\Conflict::NODE_WITH_SAME_NAME_ALREADY_EXISTS |
540 | 540 | ); |
@@ -169,10 +169,10 @@ discard block |
||
169 | 169 | * @param string $id |
170 | 170 | * @param string $path |
171 | 171 | * @param string $class Force set node type |
172 | - * @param bool $deleted |
|
172 | + * @param integer $deleted |
|
173 | 173 | * @param bool $multiple Allow $id to be an array |
174 | 174 | * @param bool $allow_root Allow instance of root collection |
175 | - * @param bool $deleted How to handle deleted node |
|
175 | + * @param integer $deleted How to handle deleted node |
|
176 | 176 | * @return INode |
177 | 177 | */ |
178 | 178 | protected function _getNode( |
@@ -280,7 +280,7 @@ discard block |
||
280 | 280 | * @param string $destid |
281 | 281 | * @param string $destp |
282 | 282 | * @param int $conflict |
283 | - * @return void |
|
283 | + * @return Response |
|
284 | 284 | */ |
285 | 285 | public function postUndelete( |
286 | 286 | $id=null, |
@@ -503,7 +503,7 @@ discard block |
||
503 | 503 | * |
504 | 504 | * @param string $p |
505 | 505 | * @param int $offset |
506 | - * @param int $legnth |
|
506 | + * @param int $length |
|
507 | 507 | * @param string $encode |
508 | 508 | * @param bool $download |
509 | 509 | * @param string $name |
@@ -15,7 +15,6 @@ |
||
15 | 15 | use Balloon\Controller; |
16 | 16 | use Balloon\Helper; |
17 | 17 | use Balloon\Filesystem\Node\INode; |
18 | -use Balloon\Filesystem\Node\Root; |
|
19 | 18 | use Balloon\Filesystem\Node\Collection; |
20 | 19 | use Balloon\Filesystem\Node\Node as CoreNode; |
21 | 20 | use Balloon\Http\Response; |
@@ -209,7 +209,6 @@ discard block |
||
209 | 209 | * curl -XHEAD "https://SERVER/api/v1/node?id=544627ed3c58891f058b4686" |
210 | 210 | * curl -XHEAD "https://SERVER/api/v1/node/544627ed3c58891f058b4686" |
211 | 211 | * curl -XHEAD "https://SERVER/api/v1/node?p=/absolute/path/to/my/node" |
212 | - |
|
213 | 212 | * @apiParam (GET Parameter) {number} [deleted=0] Wherever include deleted node or not, possible values:</br> |
214 | 213 | * - 0 Exclude deleted</br> |
215 | 214 | * - 1 Only deleted</br> |
@@ -666,9 +665,9 @@ discard block |
||
666 | 665 | $node->zip($archive); |
667 | 666 | } catch (\Exception $e) { |
668 | 667 | $this->logger->debug('failed zip node in multi node request ['.$node->getId().']', [ |
669 | - 'category' => get_class($this), |
|
670 | - 'exception' => $e, |
|
671 | - ]); |
|
668 | + 'category' => get_class($this), |
|
669 | + 'exception' => $e, |
|
670 | + ]); |
|
672 | 671 | } |
673 | 672 | } |
674 | 673 | |
@@ -900,8 +899,8 @@ discard block |
||
900 | 899 | { |
901 | 900 | $result = Helper::escape( |
902 | 901 | $this->_getNode($id, $p) |
903 | - ->getParent() |
|
904 | - ->getAttribute($attributes) |
|
902 | + ->getParent() |
|
903 | + ->getAttribute($attributes) |
|
905 | 904 | ); |
906 | 905 | |
907 | 906 | return (new Response())->setCode(200)->setBody($result); |
@@ -1641,7 +1640,6 @@ discard block |
||
1641 | 1640 | * - moveCollection |
1642 | 1641 | * - moveCollectionReference |
1643 | 1642 | * - moveCollectionShare |
1644 | - |
|
1645 | 1643 | * @apiExample (cURL) example: |
1646 | 1644 | * curl -XGET "https://SERVER/api/v1/node/event-log?pretty" |
1647 | 1645 | * curl -XGET "https://SERVER/api/v1/node/event-log?id=544627ed3c58891f058b4686&pretty" |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -declare(strict_types=1); |
|
2 | +declare(strict_types = 1); |
|
3 | 3 | |
4 | 4 | /** |
5 | 5 | * Balloon |
@@ -176,12 +176,12 @@ discard block |
||
176 | 176 | * @return INode |
177 | 177 | */ |
178 | 178 | protected function _getNode( |
179 | - ?string $id=null, |
|
180 | - ?string $path=null, |
|
181 | - ?string $class=null, |
|
182 | - bool $multiple=false, |
|
183 | - bool $allow_root=false, |
|
184 | - int $deleted=2): INode |
|
179 | + ?string $id = null, |
|
180 | + ?string $path = null, |
|
181 | + ?string $class = null, |
|
182 | + bool $multiple = false, |
|
183 | + bool $allow_root = false, |
|
184 | + int $deleted = 2) : INode |
|
185 | 185 | { |
186 | 186 | if ($class === null) { |
187 | 187 | $class = join('', array_slice(explode('\\', get_class($this)), -1)); |
@@ -226,7 +226,7 @@ discard block |
||
226 | 226 | * @param int $deleted |
227 | 227 | * @return Response |
228 | 228 | */ |
229 | - public function head(?string $id=null, ?string $p=null, int $deleted=0): Response |
|
229 | + public function head(?string $id = null, ?string $p = null, int $deleted = 0) : Response |
|
230 | 230 | { |
231 | 231 | try { |
232 | 232 | $result = $this->_getNode($id, $p, null, false, false, $deleted); |
@@ -283,12 +283,12 @@ discard block |
||
283 | 283 | * @return void |
284 | 284 | */ |
285 | 285 | public function postUndelete( |
286 | - $id=null, |
|
287 | - ?string $p=null, |
|
288 | - bool $move=false, |
|
289 | - ?string $destid=null, |
|
290 | - ?string $destp=null, |
|
291 | - int $conflict=0): Response |
|
286 | + $id = null, |
|
287 | + ?string $p = null, |
|
288 | + bool $move = false, |
|
289 | + ?string $destid = null, |
|
290 | + ?string $destp = null, |
|
291 | + int $conflict = 0) : Response |
|
292 | 292 | { |
293 | 293 | if ($move == true) { |
294 | 294 | try { |
@@ -380,7 +380,7 @@ discard block |
||
380 | 380 | * @param array $options |
381 | 381 | * @return Response |
382 | 382 | */ |
383 | - public function postShareLink(?string $id=null, ?string $p=null, array $options=[]): Response |
|
383 | + public function postShareLink(?string $id = null, ?string $p = null, array $options = []) : Response |
|
384 | 384 | { |
385 | 385 | $node = $this->_getNode($id, $p); |
386 | 386 | $options = Helper::filter($options); |
@@ -411,7 +411,7 @@ discard block |
||
411 | 411 | * @param string $p |
412 | 412 | * @return Response |
413 | 413 | */ |
414 | - public function deleteShareLink(?string $id=null, ?string $p=null): Response |
|
414 | + public function deleteShareLink(?string $id = null, ?string $p = null) : Response |
|
415 | 415 | { |
416 | 416 | $node = $this->_getNode($id, $p); |
417 | 417 | |
@@ -454,7 +454,7 @@ discard block |
||
454 | 454 | * @param string $p |
455 | 455 | * @return Response |
456 | 456 | */ |
457 | - public function getShareLink(?string $id=null, ?string $p=null): Response |
|
457 | + public function getShareLink(?string $id = null, ?string $p = null) : Response |
|
458 | 458 | { |
459 | 459 | $result = Helper::escape( |
460 | 460 | $this->_getNode($id, $p)->getShareLink() |
@@ -510,13 +510,13 @@ discard block |
||
510 | 510 | * @return void |
511 | 511 | */ |
512 | 512 | public function get( |
513 | - $id=null, |
|
514 | - ?string $p=null, |
|
515 | - int $offset=0, |
|
516 | - int $length=0, |
|
517 | - ?string $encode=null, |
|
518 | - bool $download=false, |
|
519 | - string $name='selected'): void |
|
513 | + $id = null, |
|
514 | + ?string $p = null, |
|
515 | + int $offset = 0, |
|
516 | + int $length = 0, |
|
517 | + ?string $encode = null, |
|
518 | + bool $download = false, |
|
519 | + string $name = 'selected') : void |
|
520 | 520 | { |
521 | 521 | if (is_array($id)) { |
522 | 522 | $this->_combine($id, $p, $name); |
@@ -533,13 +533,13 @@ discard block |
||
533 | 533 | } |
534 | 534 | |
535 | 535 | if ($download == true) { |
536 | - header('Content-Disposition: attachment; filename*=UTF-8\'\'' .rawurlencode($name)); |
|
536 | + header('Content-Disposition: attachment; filename*=UTF-8\'\''.rawurlencode($name)); |
|
537 | 537 | header('Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0'); |
538 | 538 | header('Content-Type: application/octet-stream'); |
539 | 539 | header('Content-Length: '.$node->getSize()); |
540 | 540 | header('Content-Transfer-Encoding: binary'); |
541 | 541 | } else { |
542 | - header('Content-Disposition: inline; filename*=UTF-8\'\'' .rawurlencode($name)); |
|
542 | + header('Content-Disposition: inline; filename*=UTF-8\'\''.rawurlencode($name)); |
|
543 | 543 | } |
544 | 544 | |
545 | 545 | if ($stream === null) { |
@@ -608,7 +608,7 @@ discard block |
||
608 | 608 | * @param string $p |
609 | 609 | * @return Response |
610 | 610 | */ |
611 | - public function postReadonly($id=null, ?string $p=null, bool $readonly=true): Response |
|
611 | + public function postReadonly($id = null, ?string $p = null, bool $readonly = true) : Response |
|
612 | 612 | { |
613 | 613 | if (is_array($id)) { |
614 | 614 | $failures = []; |
@@ -651,7 +651,7 @@ discard block |
||
651 | 651 | * @param string $name |
652 | 652 | * @return void |
653 | 653 | */ |
654 | - protected function _combine($id=null, ?string $path=null, string $name='selected'): void |
|
654 | + protected function _combine($id = null, ?string $path = null, string $name = 'selected') : void |
|
655 | 655 | { |
656 | 656 | $temp = $this->config->dir->temp.DIRECTORY_SEPARATOR.'zip'; |
657 | 657 | if (!file_exists($temp)) { |
@@ -776,10 +776,10 @@ discard block |
||
776 | 776 | * @param array $attributes |
777 | 777 | * @return Response |
778 | 778 | */ |
779 | - public function getAttributes($id=null, ?string $p=null, array $attributes=[]): Response |
|
779 | + public function getAttributes($id = null, ?string $p = null, array $attributes = []) : Response |
|
780 | 780 | { |
781 | 781 | if (is_array($id)) { |
782 | - $nodes = []; |
|
782 | + $nodes = []; |
|
783 | 783 | foreach ($this->fs->findNodes($id) as $node) { |
784 | 784 | $nodes[] = Helper::escape($node->getAttribute($attributes)); |
785 | 785 | } |
@@ -905,7 +905,7 @@ discard block |
||
905 | 905 | * @param array $attributes |
906 | 906 | * @return Response |
907 | 907 | */ |
908 | - public function getParent(?string $id=null, ?string $p=null, array $attributes=[]): Response |
|
908 | + public function getParent(?string $id = null, ?string $p = null, array $attributes = []) : Response |
|
909 | 909 | { |
910 | 910 | $result = Helper::escape( |
911 | 911 | $this->_getNode($id, $p) |
@@ -987,7 +987,7 @@ discard block |
||
987 | 987 | * @param array $attributes |
988 | 988 | * @return Response |
989 | 989 | */ |
990 | - public function getParents(?string $id=null, ?string $p=null, array $attributes=[], bool $self=false): Response |
|
990 | + public function getParents(?string $id = null, ?string $p = null, array $attributes = [], bool $self = false) : Response |
|
991 | 991 | { |
992 | 992 | $request = $this->_getNode($id, $p); |
993 | 993 | $parents = $request->getParents(); |
@@ -1035,7 +1035,7 @@ discard block |
||
1035 | 1035 | * @param string $p |
1036 | 1036 | * @return Response |
1037 | 1037 | */ |
1038 | - public function postMetaAttributes(?string $id=null, ?string $p=null): Response |
|
1038 | + public function postMetaAttributes(?string $id = null, ?string $p = null) : Response |
|
1039 | 1039 | { |
1040 | 1040 | $this->_getNode($id, $p)->setMetaAttribute(Helper::filter($_POST)); |
1041 | 1041 | return (new Response())->setCode(204); |
@@ -1068,7 +1068,7 @@ discard block |
||
1068 | 1068 | * @param string $name |
1069 | 1069 | * @return Response |
1070 | 1070 | */ |
1071 | - public function postName(string $name, ?string $id=null, ?string $p=null): Response |
|
1071 | + public function postName(string $name, ?string $id = null, ?string $p = null) : Response |
|
1072 | 1072 | { |
1073 | 1073 | $this->_getNode($id, $p)->setName($name); |
1074 | 1074 | return (new Response())->setCode(204); |
@@ -1106,11 +1106,11 @@ discard block |
||
1106 | 1106 | * @return Response |
1107 | 1107 | */ |
1108 | 1108 | public function postClone( |
1109 | - $id=null, |
|
1110 | - ?string $p=null, |
|
1111 | - ?string $destid=null, |
|
1112 | - ?string $destp=null, |
|
1113 | - int $conflict=0): Response |
|
1109 | + $id = null, |
|
1110 | + ?string $p = null, |
|
1111 | + ?string $destid = null, |
|
1112 | + ?string $destp = null, |
|
1113 | + int $conflict = 0) : Response |
|
1114 | 1114 | { |
1115 | 1115 | try { |
1116 | 1116 | $parent = $this->_getNode($destid, $destp, 'Collection', false, true); |
@@ -1192,11 +1192,11 @@ discard block |
||
1192 | 1192 | * @return Response |
1193 | 1193 | */ |
1194 | 1194 | public function postMove( |
1195 | - $id=null, |
|
1196 | - ?string $p=null, |
|
1197 | - ?string $destid=null, |
|
1198 | - ?string $destp=null, |
|
1199 | - int $conflict=0): Response |
|
1195 | + $id = null, |
|
1196 | + ?string $p = null, |
|
1197 | + ?string $destid = null, |
|
1198 | + ?string $destp = null, |
|
1199 | + int $conflict = 0) : Response |
|
1200 | 1200 | { |
1201 | 1201 | try { |
1202 | 1202 | $parent = $this->_getNode($destid, $destp, 'Collection', false, true); |
@@ -1276,11 +1276,11 @@ discard block |
||
1276 | 1276 | * @return Response |
1277 | 1277 | */ |
1278 | 1278 | public function delete( |
1279 | - $id=null, |
|
1280 | - ?string $p=null, |
|
1281 | - bool $force=false, |
|
1282 | - bool $ignore_flag=false, |
|
1283 | - ?string $at=null): Response |
|
1279 | + $id = null, |
|
1280 | + ?string $p = null, |
|
1281 | + bool $force = false, |
|
1282 | + bool $ignore_flag = false, |
|
1283 | + ?string $at = null) : Response |
|
1284 | 1284 | { |
1285 | 1285 | $failures = []; |
1286 | 1286 | |
@@ -1373,7 +1373,7 @@ discard block |
||
1373 | 1373 | * @param array $attributes |
1374 | 1374 | * @return Response |
1375 | 1375 | */ |
1376 | - public function getQuery(int $deleted=0, array $filter=[], array $attributes=[]): Response |
|
1376 | + public function getQuery(int $deleted = 0, array $filter = [], array $attributes = []): Response |
|
1377 | 1377 | { |
1378 | 1378 | $children = []; |
1379 | 1379 | $nodes = $this->fs->findNodesWithCustomFilterUser($deleted, $filter); |
@@ -1414,7 +1414,7 @@ discard block |
||
1414 | 1414 | * @param array $attributes |
1415 | 1415 | * @return Response |
1416 | 1416 | */ |
1417 | - public function getTrash(array $attributes=[]): Response |
|
1417 | + public function getTrash(array $attributes = []): Response |
|
1418 | 1418 | { |
1419 | 1419 | $children = []; |
1420 | 1420 | $nodes = $this->fs->findNodesWithCustomFilterUser(INode::DELETED_ONLY, ['deleted' => ['$type' => 9]]); |
@@ -1489,7 +1489,7 @@ discard block |
||
1489 | 1489 | * @param int $deleted |
1490 | 1490 | * @return Response |
1491 | 1491 | */ |
1492 | - public function getSearch(array $query, array $attributes=[], int $deleted=0): Response |
|
1492 | + public function getSearch(array $query, array $attributes = [], int $deleted = 0): Response |
|
1493 | 1493 | { |
1494 | 1494 | $children = []; |
1495 | 1495 | $nodes = $this->fs->search($query, $deleted); |
@@ -1599,11 +1599,11 @@ discard block |
||
1599 | 1599 | * @return Response |
1600 | 1600 | */ |
1601 | 1601 | public function getDelta( |
1602 | - ?string $id=null, |
|
1603 | - ?string $p=null, |
|
1604 | - ?string $cursor=null, |
|
1605 | - int $limit=250, |
|
1606 | - array $attributes=[]): Response |
|
1602 | + ?string $id = null, |
|
1603 | + ?string $p = null, |
|
1604 | + ?string $cursor = null, |
|
1605 | + int $limit = 250, |
|
1606 | + array $attributes = []) : Response |
|
1607 | 1607 | { |
1608 | 1608 | if ($id !== null || $p !== null) { |
1609 | 1609 | $node = $this->_getNode($id, $p); |
@@ -1611,7 +1611,7 @@ discard block |
||
1611 | 1611 | $node = null; |
1612 | 1612 | } |
1613 | 1613 | |
1614 | - $result= $this->fs->getDelta()->getDeltaFeed($cursor, $limit, $attributes, $node); |
|
1614 | + $result = $this->fs->getDelta()->getDeltaFeed($cursor, $limit, $attributes, $node); |
|
1615 | 1615 | |
1616 | 1616 | return (new Response())->setCode(200)->setBody($result); |
1617 | 1617 | } |
@@ -1719,7 +1719,7 @@ discard block |
||
1719 | 1719 | * @param int $limit |
1720 | 1720 | * @return Response |
1721 | 1721 | */ |
1722 | - public function getEventLog(?string $id=null, ?string $p=null, int $skip=0, int $limit=100): Response |
|
1722 | + public function getEventLog(?string $id = null, ?string $p = null, int $skip = 0, int $limit = 100) : Response |
|
1723 | 1723 | { |
1724 | 1724 | if ($id !== null || $p !== null) { |
1725 | 1725 | $node = $this->_getNode($id, $p); |
@@ -1759,7 +1759,7 @@ discard block |
||
1759 | 1759 | * @param string $p |
1760 | 1760 | * @return Response |
1761 | 1761 | */ |
1762 | - public function getLastCursor(?string $id=null, ?string $p=null): Response |
|
1762 | + public function getLastCursor(?string $id = null, ?string $p = null) : Response |
|
1763 | 1763 | { |
1764 | 1764 | if ($id !== null || $p !== null) { |
1765 | 1765 | $node = $this->_getNode($id, $p); |
@@ -1767,7 +1767,7 @@ discard block |
||
1767 | 1767 | $node = null; |
1768 | 1768 | } |
1769 | 1769 | |
1770 | - $result= $this->fs->getDelta()->getLastCursor(); |
|
1770 | + $result = $this->fs->getDelta()->getLastCursor(); |
|
1771 | 1771 | return (new Response())->setCode(200)->setBody($result); |
1772 | 1772 | } |
1773 | 1773 | } |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | * |
74 | 74 | * @param string $uid |
75 | 75 | * @param string $uname |
76 | - * @return User |
|
76 | + * @return CoreUser |
|
77 | 77 | */ |
78 | 78 | public function _getUser(?string $uid=null, ?string $uname=null) |
79 | 79 | { |
@@ -249,7 +249,7 @@ discard block |
||
249 | 249 | * |
250 | 250 | * @param string $uid |
251 | 251 | * @param string $uname |
252 | - * @return void |
|
252 | + * @return Response |
|
253 | 253 | */ |
254 | 254 | public function getGroups(?string $uid=null, ?string $uname=null): Response |
255 | 255 | { |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -declare(strict_types=1); |
|
2 | +declare(strict_types = 1); |
|
3 | 3 | |
4 | 4 | /** |
5 | 5 | * Balloon |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | * @param string $uname |
76 | 76 | * @return User |
77 | 77 | */ |
78 | - public function _getUser(?string $uid=null, ?string $uname=null) |
|
78 | + public function _getUser(?string $uid = null, ?string $uname = null) |
|
79 | 79 | { |
80 | 80 | if ($uid !== null || $uname !== null) { |
81 | 81 | if ($this->user->isAdmin()) { |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | * @param string $uname |
139 | 139 | * @return Response |
140 | 140 | */ |
141 | - public function getIsAdmin(?string $uid=null, ?string $uname=null): Response |
|
141 | + public function getIsAdmin(?string $uid = null, ?string $uname = null) : Response |
|
142 | 142 | { |
143 | 143 | $result = $this->_getUser($uid, $uname)->isAdmin(); |
144 | 144 | return (new Response())->setCode(200)->setBody($result); |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | * @param string $uname |
175 | 175 | * @return Response |
176 | 176 | */ |
177 | - public function getWhoami(?string $uid=null, ?string $uname=null): Response |
|
177 | + public function getWhoami(?string $uid = null, ?string $uname = null) : Response |
|
178 | 178 | { |
179 | 179 | $result = $this->_getUser($uid, $uname)->getUsername(); |
180 | 180 | return (new Response())->setCode(200)->setBody($result); |
@@ -212,7 +212,7 @@ discard block |
||
212 | 212 | * @param int $limit |
213 | 213 | * @return Response |
214 | 214 | */ |
215 | - public function getNodeAttributeSummary(?string $uid=null, ?string $uname=null, array $attributes=[], int $limit=25): Response |
|
215 | + public function getNodeAttributeSummary(?string $uid = null, ?string $uname = null, array $attributes = [], int $limit = 25) : Response |
|
216 | 216 | { |
217 | 217 | $result = $this->_getUser($uid, $uname)->getNodeAttributeSummary($attributes, $limit); |
218 | 218 | return (new Response())->setCode(200)->setBody($result); |
@@ -251,7 +251,7 @@ discard block |
||
251 | 251 | * @param string $uname |
252 | 252 | * @return void |
253 | 253 | */ |
254 | - public function getGroups(?string $uid=null, ?string $uname=null): Response |
|
254 | + public function getGroups(?string $uid = null, ?string $uname = null) : Response |
|
255 | 255 | { |
256 | 256 | $result = $this->_getUser($uid, $uname)->getGroups(); |
257 | 257 | return (new Response())->setCode(200)->setBody($result); |
@@ -290,7 +290,7 @@ discard block |
||
290 | 290 | * @param string $uname |
291 | 291 | * @return Response |
292 | 292 | */ |
293 | - public function getShares(?string $uid=null, ?string $uname=null): Response |
|
293 | + public function getShares(?string $uid = null, ?string $uname = null) : Response |
|
294 | 294 | { |
295 | 295 | $result = $this->_getUser($uid, $uname)->getShares(); |
296 | 296 | return (new Response())->setCode(200)->setBody($result); |
@@ -335,7 +335,7 @@ discard block |
||
335 | 335 | * @param string $uname |
336 | 336 | * @return Response |
337 | 337 | */ |
338 | - public function getQuotaUsage(?string $uid=null, ?string $uname=null): Response |
|
338 | + public function getQuotaUsage(?string $uid = null, ?string $uname = null) : Response |
|
339 | 339 | { |
340 | 340 | $result = $this->_getUser($uid, $uname)->getQuotaUsage(); |
341 | 341 | return (new Response())->setCode(200)->setBody($result); |
@@ -373,7 +373,7 @@ discard block |
||
373 | 373 | * @param string $attributes |
374 | 374 | * @return Response |
375 | 375 | */ |
376 | - public function getAttributes(?string $uid=null, ?string $uname=null, array $attributes=[]): Response |
|
376 | + public function getAttributes(?string $uid = null, ?string $uname = null, array $attributes = []) : Response |
|
377 | 377 | { |
378 | 378 | $result = $this->_getUser($uid, $uname)->getAttribute($attributes); |
379 | 379 | return (new Response())->setCode(200)->setBody($result); |
@@ -1,5 +1,5 @@ |
||
1 | 1 | <?php |
2 | -declare(strict_types=1); |
|
2 | +declare(strict_types = 1); |
|
3 | 3 | |
4 | 4 | /** |
5 | 5 | * Balloon |