@@ -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 |
@@ -62,12 +62,12 @@ discard block |
||
62 | 62 | 'category' => get_class($this), |
63 | 63 | ]); |
64 | 64 | |
65 | - $this->container->add(get_class($composer), function () use ($composer) { |
|
65 | + $this->container->add(get_class($composer), function() use ($composer) { |
|
66 | 66 | return $composer; |
67 | 67 | }); |
68 | 68 | |
69 | 69 | $container = $this->container; |
70 | - $this->container->add(Client::class, function () use ($container) { |
|
70 | + $this->container->add(Client::class, function() use ($container) { |
|
71 | 71 | return new Client($container->getParam(Client::class, 'uri'), [], [ |
72 | 72 | 'typeMap' => [ |
73 | 73 | 'root' => 'array', |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | ]); |
78 | 78 | }); |
79 | 79 | |
80 | - $this->container->add(Database::class, function () use ($container) { |
|
80 | + $this->container->add(Database::class, function() use ($container) { |
|
81 | 81 | return $container->get(Client::class)->balloon; |
82 | 82 | }); |
83 | 83 | |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | */ |
134 | 134 | protected function setErrorHandler(): self |
135 | 135 | { |
136 | - set_error_handler(function ($severity, $message, $file, $line) { |
|
136 | + set_error_handler(function($severity, $message, $file, $line) { |
|
137 | 137 | $log = $message.' in '.$file.':'.$line; |
138 | 138 | |
139 | 139 | if (null === $this->container) { |
@@ -1,5 +1,5 @@ |
||
1 | 1 | <?php |
2 | -declare(strict_types=1); |
|
2 | +declare(strict_types = 1); |
|
3 | 3 | |
4 | 4 | /** |
5 | 5 | * Balloon |
@@ -1,5 +1,5 @@ |
||
1 | 1 | <?php |
2 | -declare(strict_types=1); |
|
2 | +declare(strict_types = 1); |
|
3 | 3 | |
4 | 4 | /** |
5 | 5 | * 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 |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | * @param string $id |
157 | 157 | * @param string $name |
158 | 158 | */ |
159 | - public function getMember(?string $id = null, ?string $name = null): Response |
|
159 | + public function getMember(?string $id = null, ?string $name = null) : Response |
|
160 | 160 | { |
161 | 161 | $result = $this->_getGroup($id, $name)->getGroups(); |
162 | 162 | |
@@ -195,7 +195,7 @@ discard block |
||
195 | 195 | * |
196 | 196 | * @return Response |
197 | 197 | */ |
198 | - public function getAttributes(?string $id = null, ?string $name = null, array $attributes = []): Response |
|
198 | + public function getAttributes(?string $id = null, ?string $name = null, array $attributes = []) : Response |
|
199 | 199 | { |
200 | 200 | $result = $this->_getGroup($id, $name)->getAttribute($attributes); |
201 | 201 | |
@@ -224,7 +224,7 @@ discard block |
||
224 | 224 | * |
225 | 225 | * @return Response |
226 | 226 | */ |
227 | - public function head(?string $id = null, ?string $name = null): Response |
|
227 | + public function head(?string $id = null, ?string $name = null) : Response |
|
228 | 228 | { |
229 | 229 | $result = $this->_getGroup($id, $name, true); |
230 | 230 | |
@@ -266,7 +266,7 @@ discard block |
||
266 | 266 | { |
267 | 267 | $id = $this->server->addGroup($name, $member, $attributes); |
268 | 268 | |
269 | - return (new Response())->setBody((string) $id)->setCode(201); |
|
269 | + return (new Response())->setBody((string)$id)->setCode(201); |
|
270 | 270 | } |
271 | 271 | |
272 | 272 | /** |
@@ -296,7 +296,7 @@ discard block |
||
296 | 296 | * |
297 | 297 | * @return Response |
298 | 298 | */ |
299 | - public function postAttributes(array $attributes = [], ?string $id = null, ?string $name = null): Response |
|
299 | + public function postAttributes(array $attributes = [], ?string $id = null, ?string $name = null) : Response |
|
300 | 300 | { |
301 | 301 | $this->_getGroup($id, $name, true)->setAttribute($attributes)->save(array_keys($attributes)); |
302 | 302 | |
@@ -338,7 +338,7 @@ discard block |
||
338 | 338 | * |
339 | 339 | * @return Response |
340 | 340 | */ |
341 | - public function delete(?string $id = null, ?string $name = null): Response |
|
341 | + public function delete(?string $id = null, ?string $name = null) : Response |
|
342 | 342 | { |
343 | 343 | $group = $this->_getGroup($id, $name, true); |
344 | 344 | $group->delete(); |
@@ -367,7 +367,7 @@ discard block |
||
367 | 367 | * |
368 | 368 | * @return Response |
369 | 369 | */ |
370 | - public function postUndelete(?string $id = null, ?string $name = null): Response |
|
370 | + public function postUndelete(?string $id = null, ?string $name = null) : Response |
|
371 | 371 | { |
372 | 372 | $this->_getGroup($id, $name)->undelete(); |
373 | 373 |
@@ -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 |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | * |
44 | 44 | * @return Response |
45 | 45 | */ |
46 | - public function headChildren(?string $id = null, ?string $p = null): Response |
|
46 | + public function headChildren(?string $id = null, ?string $p = null) : Response |
|
47 | 47 | { |
48 | 48 | $result = $this->fs->getNode($id, $p, null, false, true); |
49 | 49 | $children = $result->getSize(); |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | int $deleted = 0, |
106 | 106 | array $filter = [], |
107 | 107 | array $attributes = [] |
108 | - ): Response { |
|
108 | + ) : Response { |
|
109 | 109 | $children = []; |
110 | 110 | $nodes = $this->fs->getNode($id, $p, null, false, true)->getChildNodes($deleted, $filter); |
111 | 111 | |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | * |
156 | 156 | * @return Response |
157 | 157 | */ |
158 | - public function getShare(?string $id = null, ?string $p = null): Response |
|
158 | + public function getShare(?string $id = null, ?string $p = null) : Response |
|
159 | 159 | { |
160 | 160 | $result = $this->fs->getNode($id, $p)->getAcl(); |
161 | 161 | |
@@ -204,7 +204,7 @@ discard block |
||
204 | 204 | * |
205 | 205 | * @return Response |
206 | 206 | */ |
207 | - public function postShare(array $acl, ?string $id = null, ?string $p = null): Response |
|
207 | + public function postShare(array $acl, ?string $id = null, ?string $p = null) : Response |
|
208 | 208 | { |
209 | 209 | $node = $this->fs->getNode($id, $p); |
210 | 210 | $result = $node->share($acl); |
@@ -240,7 +240,7 @@ discard block |
||
240 | 240 | * |
241 | 241 | * @return Response |
242 | 242 | */ |
243 | - public function deleteShare(?string $id = null, ?string $p = null): Response |
|
243 | + public function deleteShare(?string $id = null, ?string $p = null) : Response |
|
244 | 244 | { |
245 | 245 | $node = $this->fs->getNode($id, $p); |
246 | 246 | $result = $node->unshare(); |
@@ -300,7 +300,7 @@ discard block |
||
300 | 300 | ?string $name = null, |
301 | 301 | array $attributes = [], |
302 | 302 | int $conflict = 0 |
303 | - ): Response { |
|
303 | + ) : Response { |
|
304 | 304 | if (null !== $p && null !== $name) { |
305 | 305 | throw new Exception\InvalidArgument('p and name can not be used at the same time'); |
306 | 306 | } |
@@ -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 | * |
156 | 156 | * @return Response |
157 | 157 | */ |
158 | - public function getIsAdmin(?string $uid = null, ?string $uname = null): Response |
|
158 | + public function getIsAdmin(?string $uid = null, ?string $uname = null) : Response |
|
159 | 159 | { |
160 | 160 | $result = $this->_getUser($uid, $uname)->isAdmin(); |
161 | 161 | |
@@ -192,7 +192,7 @@ discard block |
||
192 | 192 | * |
193 | 193 | * @return Response |
194 | 194 | */ |
195 | - public function getWhoami(?string $uid = null, ?string $uname = null): Response |
|
195 | + public function getWhoami(?string $uid = null, ?string $uname = null) : Response |
|
196 | 196 | { |
197 | 197 | $result = $this->_getUser($uid, $uname)->getUsername(); |
198 | 198 | |
@@ -231,7 +231,7 @@ discard block |
||
231 | 231 | * |
232 | 232 | * @return Response |
233 | 233 | */ |
234 | - public function getNodeAttributeSummary(?string $uid = null, ?string $uname = null, array $attributes = [], int $limit = 25): Response |
|
234 | + public function getNodeAttributeSummary(?string $uid = null, ?string $uname = null, array $attributes = [], int $limit = 25) : Response |
|
235 | 235 | { |
236 | 236 | $result = $this->_getUser($uid, $uname)->getNodeAttributeSummary($attributes, $limit); |
237 | 237 | |
@@ -269,7 +269,7 @@ discard block |
||
269 | 269 | * @param string $uid |
270 | 270 | * @param string $uname |
271 | 271 | */ |
272 | - public function getGroups(?string $uid = null, ?string $uname = null): Response |
|
272 | + public function getGroups(?string $uid = null, ?string $uname = null) : Response |
|
273 | 273 | { |
274 | 274 | $result = $this->_getUser($uid, $uname)->getGroups(); |
275 | 275 | |
@@ -309,7 +309,7 @@ discard block |
||
309 | 309 | * |
310 | 310 | * @return Response |
311 | 311 | */ |
312 | - public function getShares(?string $uid = null, ?string $uname = null): Response |
|
312 | + public function getShares(?string $uid = null, ?string $uname = null) : Response |
|
313 | 313 | { |
314 | 314 | $result = $this->_getUser($uid, $uname)->getShares(); |
315 | 315 | |
@@ -355,7 +355,7 @@ discard block |
||
355 | 355 | * |
356 | 356 | * @return Response |
357 | 357 | */ |
358 | - public function getQuotaUsage(?string $uid = null, ?string $uname = null): Response |
|
358 | + public function getQuotaUsage(?string $uid = null, ?string $uname = null) : Response |
|
359 | 359 | { |
360 | 360 | $result = $this->_getUser($uid, $uname)->getQuotaUsage(); |
361 | 361 | |
@@ -394,7 +394,7 @@ discard block |
||
394 | 394 | * |
395 | 395 | * @return Response |
396 | 396 | */ |
397 | - public function getAttributes(?string $uid = null, ?string $uname = null, array $attributes = []): Response |
|
397 | + public function getAttributes(?string $uid = null, ?string $uname = null, array $attributes = []) : Response |
|
398 | 398 | { |
399 | 399 | $result = $this->_getUser($uid, $uname)->getAttribute($attributes); |
400 | 400 | |
@@ -423,7 +423,7 @@ discard block |
||
423 | 423 | * |
424 | 424 | * @return Response |
425 | 425 | */ |
426 | - public function head(?string $uid = null, ?string $uname = null): Response |
|
426 | + public function head(?string $uid = null, ?string $uname = null) : Response |
|
427 | 427 | { |
428 | 428 | $result = $this->_getUser($uid, $uname, true); |
429 | 429 | |
@@ -464,7 +464,7 @@ discard block |
||
464 | 464 | * |
465 | 465 | * @return Response |
466 | 466 | */ |
467 | - public function post(string $username, string $mail, ?string $namespace = null, ?string $password = null, int $hard_quota = 10000000, int $soft_quota = 10000000): Response |
|
467 | + public function post(string $username, string $mail, ?string $namespace = null, ?string $password = null, int $hard_quota = 10000000, int $soft_quota = 10000000) : Response |
|
468 | 468 | { |
469 | 469 | $id = $this->server->addUser($username, $password, [ |
470 | 470 | 'mail' => $mail, |
@@ -473,7 +473,7 @@ discard block |
||
473 | 473 | 'soft_quota' => $soft_quota, |
474 | 474 | ]); |
475 | 475 | |
476 | - return (new Response())->setBody((string) $id)->setCode(201); |
|
476 | + return (new Response())->setBody((string)$id)->setCode(201); |
|
477 | 477 | } |
478 | 478 | |
479 | 479 | /** |
@@ -503,7 +503,7 @@ discard block |
||
503 | 503 | * |
504 | 504 | * @return Response |
505 | 505 | */ |
506 | - public function postAttributes(array $attributes = [], ?string $uid = null, ?string $uname = null): Response |
|
506 | + public function postAttributes(array $attributes = [], ?string $uid = null, ?string $uname = null) : Response |
|
507 | 507 | { |
508 | 508 | $this->_getUser($uid, $uname, true)->setAttribute($attributes)->save(array_keys($attributes)); |
509 | 509 | |
@@ -546,7 +546,7 @@ discard block |
||
546 | 546 | * |
547 | 547 | * @return Response |
548 | 548 | */ |
549 | - public function delete(?string $uid = null, ?string $uname = null, bool $force = false): Response |
|
549 | + public function delete(?string $uid = null, ?string $uname = null, bool $force = false) : Response |
|
550 | 550 | { |
551 | 551 | $user = $this->_getUser($uid, $uname, true); |
552 | 552 | |
@@ -583,7 +583,7 @@ discard block |
||
583 | 583 | * |
584 | 584 | * @return Response |
585 | 585 | */ |
586 | - public function postUndelete(?string $uid = null, ?string $uname = null): Response |
|
586 | + public function postUndelete(?string $uid = null, ?string $uname = null) : Response |
|
587 | 587 | { |
588 | 588 | $this->_getUser($uid, $uname, true)->undelete(); |
589 | 589 |
@@ -1,5 +1,5 @@ |
||
1 | 1 | <?php |
2 | -declare(strict_types=1); |
|
2 | +declare(strict_types = 1); |
|
3 | 3 | |
4 | 4 | /** |
5 | 5 | * Balloon |
@@ -1,5 +1,5 @@ |
||
1 | 1 | <?php |
2 | -declare(strict_types=1); |
|
2 | +declare(strict_types = 1); |
|
3 | 3 | |
4 | 4 | /** |
5 | 5 | * 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 |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | * |
70 | 70 | * @return array |
71 | 71 | */ |
72 | - public function decorate(NodeInterface $node, ?array $attributes): array |
|
72 | + public function decorate(NodeInterface $node, ? array $attributes) : array |
|
73 | 73 | { |
74 | 74 | if (null === $attributes) { |
75 | 75 | $attributes = []; |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | * |
116 | 116 | * @return array |
117 | 117 | */ |
118 | - protected function prepare(NodeInterface $node, ?array $attributes): array |
|
118 | + protected function prepare(NodeInterface $node, ? array $attributes) : array |
|
119 | 119 | { |
120 | 120 | $clean = [ |
121 | 121 | 'attributes' => [], |
@@ -170,25 +170,25 @@ discard block |
||
170 | 170 | $server = $this->server; |
171 | 171 | |
172 | 172 | return [ |
173 | - 'id' => (string) $attributes['id'], |
|
174 | - 'name' => (string) $attributes['name'], |
|
175 | - 'mime' => (string) $attributes['mime'], |
|
176 | - 'readonly' => (bool) $attributes['readonly'], |
|
173 | + 'id' => (string)$attributes['id'], |
|
174 | + 'name' => (string)$attributes['name'], |
|
175 | + 'mime' => (string)$attributes['mime'], |
|
176 | + 'readonly' => (bool)$attributes['readonly'], |
|
177 | 177 | 'directory' => $node instanceof Collection, |
178 | - 'meta' => function ($node, $requested) { |
|
179 | - return (object) $node->getMetaAttribute([]); |
|
178 | + 'meta' => function($node, $requested) { |
|
179 | + return (object)$node->getMetaAttribute([]); |
|
180 | 180 | }, |
181 | - 'size' => function ($node, $requested) { |
|
181 | + 'size' => function($node, $requested) { |
|
182 | 182 | return $node->getSize(); |
183 | 183 | }, |
184 | - 'path' => function ($node, $requested) { |
|
184 | + 'path' => function($node, $requested) { |
|
185 | 185 | try { |
186 | 186 | return $node->getPath(); |
187 | 187 | } catch (\Exception $e) { |
188 | 188 | return null; |
189 | 189 | } |
190 | 190 | }, |
191 | - 'parent' => function ($node, $requested) { |
|
191 | + 'parent' => function($node, $requested) { |
|
192 | 192 | $parent = $node->getParent(); |
193 | 193 | |
194 | 194 | if (null === $parent || $parent->isRoot()) { |
@@ -197,10 +197,10 @@ discard block |
||
197 | 197 | |
198 | 198 | return $this->decorate($node->getParent(), $requested['parent']); |
199 | 199 | }, |
200 | - 'access' => function ($node, $requested) use ($acl) { |
|
200 | + 'access' => function($node, $requested) use ($acl) { |
|
201 | 201 | return $acl->getAclPrivilege($node); |
202 | 202 | }, |
203 | - 'owner' => function ($node, $requested) use ($server) { |
|
203 | + 'owner' => function($node, $requested) use ($server) { |
|
204 | 204 | try { |
205 | 205 | return $server->getUserById($node->getOwner())->getAttribute($requested['owner']); |
206 | 206 | } catch (\Exception $e) { |
@@ -221,20 +221,20 @@ discard block |
||
221 | 221 | protected function getTimeAttributes(NodeInterface $node, array $attributes): array |
222 | 222 | { |
223 | 223 | return [ |
224 | - 'created' => function ($node, $requested) use ($attributes) { |
|
224 | + 'created' => function($node, $requested) use ($attributes) { |
|
225 | 225 | return Helper::DateTimeToUnix($attributes['created']); |
226 | 226 | }, |
227 | - 'changed' => function ($node, $requested) use ($attributes) { |
|
227 | + 'changed' => function($node, $requested) use ($attributes) { |
|
228 | 228 | return Helper::DateTimeToUnix($attributes['changed']); |
229 | 229 | }, |
230 | - 'deleted' => function ($node, $requested) use ($attributes) { |
|
230 | + 'deleted' => function($node, $requested) use ($attributes) { |
|
231 | 231 | if (false === $attributes['deleted']) { |
232 | 232 | return false; |
233 | 233 | } |
234 | 234 | |
235 | 235 | return Helper::DateTimeToUnix($attributes['deleted']); |
236 | 236 | }, |
237 | - 'destroy' => function ($node, $requested) use ($attributes) { |
|
237 | + 'destroy' => function($node, $requested) use ($attributes) { |
|
238 | 238 | if (false === $attributes['destroy']) { |
239 | 239 | return false; |
240 | 240 | } |
@@ -267,14 +267,14 @@ discard block |
||
267 | 267 | return [ |
268 | 268 | 'shared' => $node->isShared(), |
269 | 269 | 'reference' => $node->isReference(), |
270 | - 'filter' => function ($node, $requested) use ($attributes) { |
|
270 | + 'filter' => function($node, $requested) use ($attributes) { |
|
271 | 271 | if (null === $attributes['filter']) { |
272 | 272 | return null; |
273 | 273 | } |
274 | 274 | |
275 | 275 | return json_decode($attributes['filter']); |
276 | 276 | }, |
277 | - 'share' => function ($node, $requested) { |
|
277 | + 'share' => function($node, $requested) { |
|
278 | 278 | if ($node->isShare() || !$node->isSpecial()) { |
279 | 279 | return null; |
280 | 280 | } |
@@ -285,7 +285,7 @@ discard block |
||
285 | 285 | return null; |
286 | 286 | } |
287 | 287 | }, |
288 | - 'shareowner' => function ($node, $requested) use ($server, $fs) { |
|
288 | + 'shareowner' => function($node, $requested) use ($server, $fs) { |
|
289 | 289 | if ($node->isShare() || !$node->isSpecial()) { |
290 | 290 | return null; |
291 | 291 | } |