@@ -248,7 +248,7 @@ discard block |
||
248 | 248 | { |
249 | 249 | $decorator = $this->decorator; |
250 | 250 | |
251 | - return preg_replace_callback('/(\{node\.(([a-z]\.*)+)\})/', function ($match) use ($node, $decorator) { |
|
251 | + return preg_replace_callback('/(\{node\.(([a-z]\.*)+)\})/', function($match) use ($node, $decorator) { |
|
252 | 252 | $key = explode('.', $match[2]); |
253 | 253 | $key = array_shift($key); |
254 | 254 | $attrs = $decorator->decorate($node, [$key]); |
@@ -267,7 +267,7 @@ discard block |
||
267 | 267 | { |
268 | 268 | $role_decorator = $this->role_decorator; |
269 | 269 | |
270 | - return preg_replace_callback('/(\{user\.(([a-z]\.*)+)\})/', function ($match) use ($user, $role_decorator) { |
|
270 | + return preg_replace_callback('/(\{user\.(([a-z]\.*)+)\})/', function($match) use ($user, $role_decorator) { |
|
271 | 271 | $key = explode('.', $match[2]); |
272 | 272 | $key = array_shift($key); |
273 | 273 | $attrs = $role_decorator->decorate($user, [$key]); |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | ->prependRoute(new Route('/api/v2/nodes|files|collections/subscription(/|\z)', v2\Subscription::class)) |
33 | 33 | ->prependRoute(new Route('/api/v2/nodes|files|collections/{id:#([0-9a-z]{24})#}/subscription(/|\z)', v2\Subscription::class)); |
34 | 34 | |
35 | - $decorator->addDecorator('subscription', function ($node) use ($notifier, $server) { |
|
35 | + $decorator->addDecorator('subscription', function($node) use ($notifier, $server) { |
|
36 | 36 | $subscription = $notifier->getSubscription($node, $server->getIdentity()); |
37 | 37 | if ($subscription === null) { |
38 | 38 | return false; |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | return true; |
42 | 42 | }); |
43 | 43 | |
44 | - $decorator->addDecorator('subscription_exclude_me', function ($node) use ($notifier, $server) { |
|
44 | + $decorator->addDecorator('subscription_exclude_me', function($node) use ($notifier, $server) { |
|
45 | 45 | $subscription = $notifier->getSubscription($node, $server->getIdentity()); |
46 | 46 | if ($subscription === null) { |
47 | 47 | return false; |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | return $subscription['exclude_me']; |
51 | 51 | }); |
52 | 52 | |
53 | - $decorator->addDecorator('subscription_recursive', function ($node) use ($notifier, $server) { |
|
53 | + $decorator->addDecorator('subscription_recursive', function($node) use ($notifier, $server) { |
|
54 | 54 | if (!($node instanceof Collection)) { |
55 | 55 | return null; |
56 | 56 | } |
@@ -82,7 +82,7 @@ |
||
82 | 82 | $node_decorator = $this->node_decorator; |
83 | 83 | $notifier = $this->notifier; |
84 | 84 | |
85 | - return $this->bulk($id, $p, function ($node) use ($node_decorator, $notifier, $subscribe, $exclude_me, $recursive) { |
|
85 | + return $this->bulk($id, $p, function($node) use ($node_decorator, $notifier, $subscribe, $exclude_me, $recursive) { |
|
86 | 86 | $notifier->subscribeNode($node, $subscribe, $exclude_me, $recursive); |
87 | 87 | |
88 | 88 | return [ |
@@ -102,7 +102,7 @@ |
||
102 | 102 | 'id' => (string) $message['_id'], |
103 | 103 | 'message' => (string) $message['body'], |
104 | 104 | 'subject' => (string) $message['subject'], |
105 | - 'sender' => function ($message) use ($server, $role_decorator) { |
|
105 | + 'sender' => function($message) use ($server, $role_decorator) { |
|
106 | 106 | if (!isset($message['sender'])) { |
107 | 107 | return null; |
108 | 108 | } |
@@ -64,7 +64,7 @@ |
||
64 | 64 | ->setHeader('Content-Type', 'application/octet-stream') |
65 | 65 | ->setHeader('Content-Transfer-Encoding', 'binary') |
66 | 66 | ->setOutputFormat(null) |
67 | - ->setBody(function () use ($url) { |
|
67 | + ->setBody(function() use ($url) { |
|
68 | 68 | $stream = fopen($url, 'r'); |
69 | 69 | while (!feof($stream)) { |
70 | 70 | echo fread($stream, 8192); |
@@ -34,7 +34,7 @@ |
||
34 | 34 | ->prependRoute(new Route('/api/v2/files/convert(/|\z)', Convert::class)) |
35 | 35 | ->prependRoute(new Route('/api/v2/files/{id:#([0-9a-z]{24})#}/convert(/|\z)', Convert::class)); |
36 | 36 | |
37 | - $node_decorator->addDecorator('master', function ($node) use ($convert_decorator, $converter) { |
|
37 | + $node_decorator->addDecorator('master', function($node) use ($convert_decorator, $converter) { |
|
38 | 38 | $master = $node->getAppAttribute('Balloon\\App\\Convert', 'master'); |
39 | 39 | if (null === $master) { |
40 | 40 | return null; |
@@ -101,14 +101,14 @@ |
||
101 | 101 | return [ |
102 | 102 | 'id' => (string) $slave['_id'], |
103 | 103 | 'format' => (string) $slave['format'], |
104 | - 'master' => function ($slave) use ($fs, $node_decorator) { |
|
104 | + 'master' => function($slave) use ($fs, $node_decorator) { |
|
105 | 105 | try { |
106 | 106 | return $node_decorator->decorate($fs->findNodeById($slave['master']), ['_links', 'id', 'name']); |
107 | 107 | } catch (\Exception $e) { |
108 | 108 | return null; |
109 | 109 | } |
110 | 110 | }, |
111 | - 'slave' => function ($slave) use ($fs, $node_decorator) { |
|
111 | + 'slave' => function($slave) use ($fs, $node_decorator) { |
|
112 | 112 | if (!isset($slave['slave'])) { |
113 | 113 | return null; |
114 | 114 | } |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | } |
73 | 73 | }); |
74 | 74 | |
75 | - $node_decorator_v2->addDecorator('sharelink_token', function ($node) use ($sharelink) { |
|
75 | + $node_decorator_v2->addDecorator('sharelink_token', function($node) use ($sharelink) { |
|
76 | 76 | $attributes = $sharelink->getSharelink($node); |
77 | 77 | |
78 | 78 | if (isset($attributes['token'])) { |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | } |
81 | 81 | }); |
82 | 82 | |
83 | - $node_decorator_v2->addDecorator('sharelink_expire', function ($node) use ($sharelink) { |
|
83 | + $node_decorator_v2->addDecorator('sharelink_expire', function($node) use ($sharelink) { |
|
84 | 84 | $attributes = $sharelink->getSharelink($node); |
85 | 85 | |
86 | 86 | if (isset($attributes['expiration'])) { |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | } |
91 | 91 | }); |
92 | 92 | |
93 | - $node_decorator_v1->addDecorator('sharelink', function ($node) use ($sharelink) { |
|
93 | + $node_decorator_v1->addDecorator('sharelink', function($node) use ($sharelink) { |
|
94 | 94 | return isset($sharelink->getSharelink($node)['token']); |
95 | 95 | }); |
96 | 96 |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | 'directory' => $node instanceof Collection, |
63 | 63 | 'meta' => $node->getMetaAttributes(), |
64 | 64 | 'size' => $node->getSize(), |
65 | - 'parent' => function ($node, $requested) use ($attributes) { |
|
65 | + 'parent' => function($node, $requested) use ($attributes) { |
|
66 | 66 | $parent = $node->getParent(); |
67 | 67 | |
68 | 68 | if (null === $parent || $parent->isRoot()) { |
@@ -75,14 +75,14 @@ discard block |
||
75 | 75 | 'share' => (string) $attributes['shared'], |
76 | 76 | 'created' => $attributes['created']->toDateTime()->format('c'), |
77 | 77 | 'changed' => $attributes['changed']->toDateTime()->format('c'), |
78 | - 'deleted' => function ($node, $requested) use ($attributes) { |
|
78 | + 'deleted' => function($node, $requested) use ($attributes) { |
|
79 | 79 | if (!$attributes['deleted']) { |
80 | 80 | return null; |
81 | 81 | } |
82 | 82 | |
83 | 83 | return $attributes['deleted']->toDateTime()->format('c'); |
84 | 84 | }, |
85 | - 'destroy' => function ($node, $requested) use ($attributes) { |
|
85 | + 'destroy' => function($node, $requested) use ($attributes) { |
|
86 | 86 | if (!$attributes['destroy']) { |
87 | 87 | return null; |
88 | 88 | } |