@@ -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 | */ |
@@ -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]); |
@@ -100,7 +100,7 @@ |
||
| 100 | 100 | * @param string $attribute |
| 101 | 101 | * @param Closure $decorator |
| 102 | 102 | * |
| 103 | - * @return AttributeDecorator |
|
| 103 | + * @return EventAttributeDecorator |
|
| 104 | 104 | */ |
| 105 | 105 | public function addDecorator(string $attribute, Closure $decorator): self |
| 106 | 106 | { |
@@ -44,7 +44,6 @@ |
||
| 44 | 44 | /** |
| 45 | 45 | * Inject hook. |
| 46 | 46 | * |
| 47 | - * @param HookInterface $adapter |
|
| 48 | 47 | * |
| 49 | 48 | * @return Hook |
| 50 | 49 | */ |
@@ -48,7 +48,7 @@ |
||
| 48 | 48 | $this->db->storage->updateOne( |
| 49 | 49 | ['_id' => $object['_id']], |
| 50 | 50 | [ |
| 51 | - '$set' => ['share_name' => $object['name']], |
|
| 51 | + '$set' => ['share_name' => $object['name']], |
|
| 52 | 52 | ] |
| 53 | 53 | ); |
| 54 | 54 | } |
@@ -100,7 +100,7 @@ |
||
| 100 | 100 | * @param string $attribute |
| 101 | 101 | * @param Closure $decorator |
| 102 | 102 | * |
| 103 | - * @return AttributeDecorator |
|
| 103 | + * @return EventDecorator |
|
| 104 | 104 | */ |
| 105 | 105 | public function addDecorator(string $attribute, Closure $decorator): self |
| 106 | 106 | { |
@@ -96,7 +96,7 @@ |
||
| 96 | 96 | * @param string $attribute |
| 97 | 97 | * @param Closure $decorator |
| 98 | 98 | * |
| 99 | - * @return AttributeDecorator |
|
| 99 | + * @return NodeDecorator |
|
| 100 | 100 | */ |
| 101 | 101 | public function addDecorator(string $attribute, Closure $decorator): self |
| 102 | 102 | { |
@@ -141,20 +141,20 @@ discard block |
||
| 141 | 141 | 'mime' => (string) $attributes['mime'], |
| 142 | 142 | 'readonly' => (bool) $attributes['readonly'], |
| 143 | 143 | 'directory' => $node instanceof Collection, |
| 144 | - 'meta' => function ($node) { |
|
| 144 | + 'meta' => function($node) { |
|
| 145 | 145 | return (object) $node->getMetaAttributes(); |
| 146 | 146 | }, |
| 147 | - 'size' => function ($node) { |
|
| 147 | + 'size' => function($node) { |
|
| 148 | 148 | return $node->getSize(); |
| 149 | 149 | }, |
| 150 | - 'path' => function ($node) { |
|
| 150 | + 'path' => function($node) { |
|
| 151 | 151 | try { |
| 152 | 152 | return $node->getPath(); |
| 153 | 153 | } catch (\Exception $e) { |
| 154 | 154 | return null; |
| 155 | 155 | } |
| 156 | 156 | }, |
| 157 | - 'parent' => function ($node) { |
|
| 157 | + 'parent' => function($node) { |
|
| 158 | 158 | $id = $node->getAttributes()['parent']; |
| 159 | 159 | |
| 160 | 160 | if (null === $id) { |
@@ -163,10 +163,10 @@ discard block |
||
| 163 | 163 | |
| 164 | 164 | return (string) $id; |
| 165 | 165 | }, |
| 166 | - 'access' => function ($node) use ($acl) { |
|
| 166 | + 'access' => function($node) use ($acl) { |
|
| 167 | 167 | return $acl->getAclPrivilege($node); |
| 168 | 168 | }, |
| 169 | - 'share' => function ($node) { |
|
| 169 | + 'share' => function($node) { |
|
| 170 | 170 | if ($node->isShared() || !$node->isSpecial()) { |
| 171 | 171 | return null; |
| 172 | 172 | } |
@@ -177,7 +177,7 @@ discard block |
||
| 177 | 177 | return null; |
| 178 | 178 | } |
| 179 | 179 | }, |
| 180 | - 'shareowner' => function ($node) use ($server, $fs) { |
|
| 180 | + 'shareowner' => function($node) use ($server, $fs) { |
|
| 181 | 181 | if (!$node->isSpecial()) { |
| 182 | 182 | return null; |
| 183 | 183 | } |
@@ -223,20 +223,20 @@ discard block |
||
| 223 | 223 | protected function getTimeAttributes(NodeInterface $node, array $attributes): array |
| 224 | 224 | { |
| 225 | 225 | return [ |
| 226 | - 'created' => function ($node) use ($attributes) { |
|
| 226 | + 'created' => function($node) use ($attributes) { |
|
| 227 | 227 | return $this->dateTimeToUnix($attributes['created']); |
| 228 | 228 | }, |
| 229 | - 'changed' => function ($node) use ($attributes) { |
|
| 229 | + 'changed' => function($node) use ($attributes) { |
|
| 230 | 230 | return $this->dateTimeToUnix($attributes['changed']); |
| 231 | 231 | }, |
| 232 | - 'deleted' => function ($node) use ($attributes) { |
|
| 232 | + 'deleted' => function($node) use ($attributes) { |
|
| 233 | 233 | if (false === $attributes['deleted']) { |
| 234 | 234 | return false; |
| 235 | 235 | } |
| 236 | 236 | |
| 237 | 237 | return $this->dateTimeToUnix($attributes['deleted']); |
| 238 | 238 | }, |
| 239 | - 'destroy' => function ($node) use ($attributes) { |
|
| 239 | + 'destroy' => function($node) use ($attributes) { |
|
| 240 | 240 | if (null === $attributes['destroy']) { |
| 241 | 241 | return null; |
| 242 | 242 | } |
@@ -80,7 +80,7 @@ |
||
| 80 | 80 | * @param string $attribute |
| 81 | 81 | * @param Closure $decorator |
| 82 | 82 | * |
| 83 | - * @return AttributeDecorator |
|
| 83 | + * @return RoleDecorator |
|
| 84 | 84 | */ |
| 85 | 85 | public function addDecorator(string $attribute, Closure $decorator): self |
| 86 | 86 | { |
@@ -105,13 +105,13 @@ discard block |
||
| 105 | 105 | } |
| 106 | 106 | |
| 107 | 107 | return [ |
| 108 | - 'created' => function ($role, $requested) use ($attributes) { |
|
| 108 | + 'created' => function($role, $requested) use ($attributes) { |
|
| 109 | 109 | return $attributes['created']->toDateTime()->format('c'); |
| 110 | 110 | }, |
| 111 | - 'changed' => function ($role, $requested) use ($attributes) { |
|
| 111 | + 'changed' => function($role, $requested) use ($attributes) { |
|
| 112 | 112 | return $attributes['changed']->toDateTime()->format('c'); |
| 113 | 113 | }, |
| 114 | - 'deleted' => function ($role, $requested) use ($attributes) { |
|
| 114 | + 'deleted' => function($role, $requested) use ($attributes) { |
|
| 115 | 115 | if (false === $attributes['deleted']) { |
| 116 | 116 | return null; |
| 117 | 117 | } |
@@ -164,14 +164,14 @@ discard block |
||
| 164 | 164 | 'name' => (string) $attributes['username'], |
| 165 | 165 | 'namespace' => (string) $attributes['namespace'], |
| 166 | 166 | 'mail' => (string) $attributes['mail'], |
| 167 | - 'avatar' => function ($role, $requested) use ($attributes) { |
|
| 167 | + 'avatar' => function($role, $requested) use ($attributes) { |
|
| 168 | 168 | if ($attributes['avatar'] instanceof Binary) { |
| 169 | 169 | return base64_encode($attributes['avatar']->getData()); |
| 170 | 170 | } |
| 171 | 171 | |
| 172 | 172 | return null; |
| 173 | 173 | }, |
| 174 | - 'soft_quota' => function ($role, $requested) use ($attributes, $user) { |
|
| 174 | + 'soft_quota' => function($role, $requested) use ($attributes, $user) { |
|
| 175 | 175 | if ($user === null) { |
| 176 | 176 | return null; |
| 177 | 177 | } |
@@ -182,7 +182,7 @@ discard block |
||
| 182 | 182 | |
| 183 | 183 | return null; |
| 184 | 184 | }, |
| 185 | - 'hard_quota' => function ($role, $requested) use ($attributes, $user) { |
|
| 185 | + 'hard_quota' => function($role, $requested) use ($attributes, $user) { |
|
| 186 | 186 | if ($user === null) { |
| 187 | 187 | return null; |
| 188 | 188 | } |
@@ -357,8 +357,6 @@ |
||
| 357 | 357 | * "data": "user" |
| 358 | 358 | * } |
| 359 | 359 | * |
| 360 | - * @param string $uid |
|
| 361 | - * @param string $uname |
|
| 362 | 360 | * |
| 363 | 361 | * @return Response |
| 364 | 362 | */ |
@@ -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 | */ |
@@ -342,7 +342,7 @@ discard block |
||
| 342 | 342 | |
| 343 | 343 | try { |
| 344 | 344 | $attributes = compact('changed', 'created', 'readonly', 'meta'); |
| 345 | - $attributes = array_filter($attributes, function ($attribute) {return !is_null($attribute); }); |
|
| 345 | + $attributes = array_filter($attributes, function($attribute) {return !is_null($attribute); }); |
|
| 346 | 346 | $attributes = $this->_verifyAttributes($attributes); |
| 347 | 347 | |
| 348 | 348 | return $this->_put($file, $id, $p, $collection, $name, $attributes, $conflict); |
@@ -463,7 +463,7 @@ discard block |
||
| 463 | 463 | $content = fopen('php://input', 'rb'); |
| 464 | 464 | |
| 465 | 465 | $attributes = compact('changed', 'created', 'readonly', 'meta'); |
| 466 | - $attributes = array_filter($attributes, function ($attribute) {return !is_null($attribute); }); |
|
| 466 | + $attributes = array_filter($attributes, function($attribute) {return !is_null($attribute); }); |
|
| 467 | 467 | $attributes = $this->_verifyAttributes($attributes); |
| 468 | 468 | |
| 469 | 469 | return $this->_put($content, $id, $p, $collection, $name, $attributes, $conflict); |