@@ -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 |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | * @return void |
126 | 126 | */ |
127 | 127 | public function postCopyCollection(Collection $node, Collection $parent, |
128 | - Collection $new_node, int $conflict, ?string $recursion, bool $recursion_first): void |
|
128 | + Collection $new_node, int $conflict, ? string $recursion, bool $recursion_first) : void |
|
129 | 129 | { |
130 | 130 | if ($recursion_first === false) { |
131 | 131 | return; |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | * @return void |
163 | 163 | */ |
164 | 164 | public function postCopyFile(File $node, Collection $parent, File $new_node, |
165 | - int $conflict, ?string $recursion, bool $recursion_first): void |
|
165 | + int $conflict, ? string $recursion, bool $recursion_first) : void |
|
166 | 166 | { |
167 | 167 | if ($recursion_first === false) { |
168 | 168 | return; |
@@ -229,14 +229,14 @@ discard block |
||
229 | 229 | * @param bool $recursion_first |
230 | 230 | * @return void |
231 | 231 | */ |
232 | - public function postDeleteCollection(Collection $node, bool $force, ?string $recursion, bool $recursion_first): void |
|
232 | + public function postDeleteCollection(Collection $node, bool $force, ? string $recursion, bool $recursion_first) : void |
|
233 | 233 | { |
234 | 234 | if ($recursion_first === false) { |
235 | 235 | return; |
236 | 236 | } |
237 | 237 | |
238 | 238 | $attributes = $node->getAttribute(['parent', 'name']); |
239 | - $attributes['node'] = $node->getId(); |
|
239 | + $attributes['node'] = $node->getId(); |
|
240 | 240 | |
241 | 241 | |
242 | 242 | if ($node->isReference()) { |
@@ -257,7 +257,7 @@ discard block |
||
257 | 257 | $attributes['share'] = $node->getShareId(); |
258 | 258 | } |
259 | 259 | |
260 | - $attributes['client']= $this->client; |
|
260 | + $attributes['client'] = $this->client; |
|
261 | 261 | $attributes['owner'] = $this->getEventOwner($node); |
262 | 262 | $attributes['force'] = $force; |
263 | 263 | $node->getFilesystem()->getDelta()->add($attributes); |
@@ -292,14 +292,14 @@ discard block |
||
292 | 292 | * @param bool $recursion_first |
293 | 293 | * @return void |
294 | 294 | */ |
295 | - public function postDeleteFile(File $node, bool $force, ?string $recursion, bool $recursion_first): void |
|
295 | + public function postDeleteFile(File $node, bool $force, ? string $recursion, bool $recursion_first) : void |
|
296 | 296 | { |
297 | 297 | if ($recursion_first === false) { |
298 | 298 | return; |
299 | 299 | } |
300 | 300 | |
301 | 301 | $attributes = $node->getAttribute(['parent', 'name']); |
302 | - $attributes['node'] = $node->getId(); |
|
302 | + $attributes['node'] = $node->getId(); |
|
303 | 303 | |
304 | 304 | if ($force === true) { |
305 | 305 | $attributes['operation'] = 'forceDeleteFile'; |
@@ -311,7 +311,7 @@ discard block |
||
311 | 311 | $attributes['share'] = $node->getShareId(); |
312 | 312 | } |
313 | 313 | |
314 | - $attributes['client']= $this->client; |
|
314 | + $attributes['client'] = $this->client; |
|
315 | 315 | $attributes['owner'] = $this->getEventOwner($node); |
316 | 316 | $attributes['force'] = $force; |
317 | 317 | $node->getFilesystem()->getDelta()->add($attributes); |
@@ -330,7 +330,7 @@ discard block |
||
330 | 330 | * @param bool $recursion_first |
331 | 331 | * @return void |
332 | 332 | */ |
333 | - public function postSaveNodeAttributes(INode $node, array $attributes, array $remove, ?string $recursion, bool $recursion_first): void |
|
333 | + public function postSaveNodeAttributes(INode $node, array $attributes, array $remove, ? string $recursion, bool $recursion_first) : void |
|
334 | 334 | { |
335 | 335 | if ($recursion_first === false) { |
336 | 336 | return; |
@@ -413,7 +413,7 @@ discard block |
||
413 | 413 | } |
414 | 414 | } |
415 | 415 | |
416 | - $log['client']= $this->client; |
|
416 | + $log['client'] = $this->client; |
|
417 | 417 | |
418 | 418 | if (isset($log['operation'])) { |
419 | 419 | $node->getFilesystem()->getDelta()->add($log); |
@@ -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 |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | * @param Iterable $config |
32 | 32 | * @return PluginInterface |
33 | 33 | */ |
34 | - public function setOptions(?Iterable $config): PluginInterface |
|
34 | + public function setOptions(? Iterable $config) : PluginInterface |
|
35 | 35 | { |
36 | 36 | if ($config === null) { |
37 | 37 | return $this; |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | */ |
58 | 58 | public function cli(Filesystem $fs): void |
59 | 59 | { |
60 | - $lt = time() - $this->max_age; |
|
60 | + $lt = time() - $this->max_age; |
|
61 | 61 | |
62 | 62 | $result = $fs->findNodesWithCustomFilter(['deleted' => ['$lt' => new UTCDateTime($lt)]]); |
63 | 63 | $this->logger->info('found ['.count($result).'] nodes for cleanup, force remove them from trash', [ |
@@ -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 |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | * @param Iterable $config |
59 | 59 | * @return PluginInterface |
60 | 60 | */ |
61 | - public function setOptions(?Iterable $config): PluginInterface |
|
61 | + public function setOptions(? Iterable $config) : PluginInterface |
|
62 | 62 | { |
63 | 63 | if ($config === null) { |
64 | 64 | return $this; |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | 'category' => get_class($this), |
101 | 101 | ]); |
102 | 102 | |
103 | - $result = $this->_findShare($share); |
|
103 | + $result = $this->_findShare($share); |
|
104 | 104 | $shares = array_merge_recursive($shares, $result); |
105 | 105 | } |
106 | 106 |
@@ -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 |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | * @param Iterable $config |
33 | 33 | * @return PluginInterface |
34 | 34 | */ |
35 | - public function setOptions(?Iterable $config): PluginInterface |
|
35 | + public function setOptions(? Iterable $config) : PluginInterface |
|
36 | 36 | { |
37 | 37 | if ($config === null) { |
38 | 38 | return $this; |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | * @param bool $autocreate |
58 | 58 | * @return void |
59 | 59 | */ |
60 | - public function preInstanceUser(User $user, string &$username, ?array &$attributes, bool $autocreate): void |
|
60 | + public function preInstanceUser(User $user, string&$username, ? array &$attributes, bool $autocreate) : void |
|
61 | 61 | { |
62 | 62 | if ($autocreate === false || $attributes !== null) { |
63 | 63 | return; |
@@ -84,19 +84,19 @@ discard block |
||
84 | 84 | |
85 | 85 | switch ($value['type']) { |
86 | 86 | case 'string': |
87 | - $attributes[$attr] = (string)$value['value']; |
|
87 | + $attributes[$attr] = (string)$value['value']; |
|
88 | 88 | break; |
89 | 89 | |
90 | 90 | case 'int': |
91 | - $attributes[$attr] = (int)$value['value']; |
|
91 | + $attributes[$attr] = (int)$value['value']; |
|
92 | 92 | break; |
93 | 93 | |
94 | 94 | case 'bool': |
95 | - $attributes[$attr] = (bool)$value['value']; |
|
95 | + $attributes[$attr] = (bool)$value['value']; |
|
96 | 96 | break; |
97 | 97 | |
98 | 98 | case 'binary': |
99 | - $attributes[$attr] = new Binary($value['value']); |
|
99 | + $attributes[$attr] = new Binary($value['value']); |
|
100 | 100 | break; |
101 | 101 | |
102 | 102 | default: |
@@ -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 |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | * @param Iterable $config |
53 | 53 | * @return PluginInterface |
54 | 54 | */ |
55 | - public function setOptions(?Iterable $config): PluginInterface |
|
55 | + public function setOptions(? Iterable $config) : PluginInterface |
|
56 | 56 | { |
57 | 57 | if ($config === null) { |
58 | 58 | return $this; |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | * @param bool $recursion_first |
108 | 108 | * @return void |
109 | 109 | */ |
110 | - public function postSaveNodeAttributes(INode $node, array $attributes, array $remove, ?string $recursion, bool $recursion_first): void |
|
110 | + public function postSaveNodeAttributes(INode $node, array $attributes, array $remove, ? string $recursion, bool $recursion_first) : void |
|
111 | 111 | { |
112 | 112 | if (!($node instanceof Collection)) { |
113 | 113 | return; |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | $acl = $node->getShare(); |
124 | 124 | $resource = new Resource($fs->getUser(), $this->logger, $fs); |
125 | 125 | if ($node->isShared() && is_array($acl) && (isset($raw['acl']) && $raw['acl'] !== $node->getAcl() || !isset($raw['acl']))) { |
126 | - $receiver=[]; |
|
126 | + $receiver = []; |
|
127 | 127 | foreach ($acl as $rule) { |
128 | 128 | if ($rule['type'] == 'user') { |
129 | 129 | $user = new User($rule['name'], $this->logger, $fs, true, false); |
@@ -142,14 +142,14 @@ discard block |
||
142 | 142 | } |
143 | 143 | |
144 | 144 | if (!empty($receiver)) { |
145 | - $body = preg_replace_callback('/(\{(([a-z]\.*)+)\})/', function ($match) use ($node) { |
|
145 | + $body = preg_replace_callback('/(\{(([a-z]\.*)+)\})/', function($match) use ($node) { |
|
146 | 146 | return $node->getAttribute($match[2]); |
147 | 147 | }, $this->notifications['new_share']['body']); |
148 | - $subject = preg_replace_callback('/(\{(([a-z]\.*)+)\})/', function ($match) use ($node) { |
|
148 | + $subject = preg_replace_callback('/(\{(([a-z]\.*)+)\})/', function($match) use ($node) { |
|
149 | 149 | return $node->getAttribute($match[2]); |
150 | 150 | }, $this->notifications['new_share']['subject']); |
151 | 151 | |
152 | - $mail = new Message(); |
|
152 | + $mail = new Message(); |
|
153 | 153 | $mail->setBody($body); |
154 | 154 | $mail->setFrom($this->notifications['new_share']['sender']['address'], |
155 | 155 | $this->notifications['new_share']['sender']['name']); |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | * @param User $user |
172 | 172 | * @return string |
173 | 173 | */ |
174 | - protected function checkNotify(INode $node, User $user): ?string |
|
174 | + protected function checkNotify(INode $node, User $user): ? string |
|
175 | 175 | { |
176 | 176 | if ($user->hasShare($node)) { |
177 | 177 | $this->logger->debug('skip mail notifcation for share ['.$node->getId().'] user ['.$user->getId().'] already owns it', [ |
@@ -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 |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | * @param string $env |
32 | 32 | * @return void |
33 | 33 | */ |
34 | - public function __construct(string $config, string $env='production') |
|
34 | + public function __construct(string $config, string $env = 'production') |
|
35 | 35 | { |
36 | 36 | $config = simplexml_load_file($config); |
37 | 37 | if ($this->store === false) { |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | * @param bool $replace |
87 | 87 | * @return bool |
88 | 88 | */ |
89 | - protected function appendSimplexml(SimpleXMLElement &$simplexml_to, SimpleXMLElement &$simplexml_from, bool $replace=true): bool |
|
89 | + protected function appendSimplexml(SimpleXMLElement&$simplexml_to, SimpleXMLElement&$simplexml_from, bool $replace = true): bool |
|
90 | 90 | { |
91 | 91 | if (count($simplexml_from->children()) === 0) { |
92 | 92 | if ($replace === true && count($simplexml_to->children()) === 0) { |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | foreach ($simplexml_from->attributes() as $attr_key => $attr_value) { |
99 | 99 | if (!isset($attrs[$attr_key])) { |
100 | 100 | $simplexml_to->addAttribute($attr_key, (string)$attr_value); |
101 | - } elseif ($replace===true) { |
|
101 | + } elseif ($replace === true) { |
|
102 | 102 | $simplexml_to->attributes()->{$attr_key} = (string)$attr_value; |
103 | 103 | } |
104 | 104 | } |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | foreach ($simplexml_child->attributes() as $attr_key => $attr_value) { |
119 | 119 | if (!isset($attrs[$attr_key])) { |
120 | 120 | $simplexml_to->{$simplexml_child->getName()}->addAttribute($attr_key, (string)$attr_value); |
121 | - } elseif ($replace===true) { |
|
121 | + } elseif ($replace === true) { |
|
122 | 122 | $simplexml_to->{$simplexml_child->getName()}->attributes()->{$attr_key} = (string)$attr_value; |
123 | 123 | } |
124 | 124 | } |
@@ -190,7 +190,7 @@ discard block |
||
190 | 190 | * @param SimpleXMLElement $xml |
191 | 191 | * @return Config |
192 | 192 | */ |
193 | - public function map($xml=null): Config |
|
193 | + public function map($xml = null): Config |
|
194 | 194 | { |
195 | 195 | if ($xml === null) { |
196 | 196 | $xml = $this->store; |
@@ -200,7 +200,7 @@ discard block |
||
200 | 200 | foreach ($xml->getNamespaces() + array(null) as $prefix => $namespace) { |
201 | 201 | foreach ($xml->attributes($namespace) as $key => $value) { |
202 | 202 | if (is_string($prefix)) { |
203 | - $key = $prefix . '.' . $key; |
|
203 | + $key = $prefix.'.'.$key; |
|
204 | 204 | } |
205 | 205 | |
206 | 206 | if ($key === 'inherits') { |
@@ -217,13 +217,13 @@ discard block |
||
217 | 217 | if (!isset($arr[$name])) { |
218 | 218 | $config[$name] = $value; |
219 | 219 | } else { |
220 | - foreach ((array) $value as $k => $v) { |
|
220 | + foreach ((array)$value as $k => $v) { |
|
221 | 221 | if (is_numeric($k)) { |
222 | 222 | $config[$name][] = $v; |
223 | 223 | } else { |
224 | 224 | $config[$name][$k] = array_merge( |
225 | - (array) $config[$name][$k], |
|
226 | - (array) $v |
|
225 | + (array)$config[$name][$k], |
|
226 | + (array)$v |
|
227 | 227 | ); |
228 | 228 | } |
229 | 229 | } |
@@ -232,7 +232,7 @@ discard block |
||
232 | 232 | $config[$name] = new Config(); |
233 | 233 | } |
234 | 234 | } |
235 | - if ($content = trim((string) $xml)) { |
|
235 | + if ($content = trim((string)$xml)) { |
|
236 | 236 | $config[] = $content; |
237 | 237 | } |
238 | 238 |
@@ -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 |
@@ -58,5 +58,5 @@ discard block |
||
58 | 58 | * @param mixed $config |
59 | 59 | * @return Config |
60 | 60 | */ |
61 | - public function map($native=null): Config; |
|
61 | + public function map($native = null): Config; |
|
62 | 62 | } |
@@ -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 |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | * |
86 | 86 | * @var bool |
87 | 87 | */ |
88 | - protected $tls=false; |
|
88 | + protected $tls = false; |
|
89 | 89 | |
90 | 90 | |
91 | 91 | /** |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | * @param Logger $logger |
104 | 104 | * @return resource |
105 | 105 | */ |
106 | - public function __construct(?Iterable $config, Logger $logger) |
|
106 | + public function __construct(? Iterable $config, Logger $logger) |
|
107 | 107 | { |
108 | 108 | $this->setOptions($config); |
109 | 109 | $this->logger = $logger; |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | * @param Iterable $config |
152 | 152 | * @return Ldap |
153 | 153 | */ |
154 | - public function setOptions(?Iterable $config): Ldap |
|
154 | + public function setOptions(? Iterable $config) : Ldap |
|
155 | 155 | { |
156 | 156 | if ($config === null) { |
157 | 157 | return $this; |
@@ -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 |
@@ -32,9 +32,9 @@ discard block |
||
32 | 32 | * @param Iterable $config |
33 | 33 | * @return void |
34 | 34 | */ |
35 | - public function __construct(Logger $logger, ?Iterable $config) |
|
35 | + public function __construct(Logger $logger, ? Iterable $config) |
|
36 | 36 | { |
37 | - $this->logger = $logger; |
|
37 | + $this->logger = $logger; |
|
38 | 38 | $this->setOptions($config); |
39 | 39 | } |
40 | 40 | } |