@@ -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 | } |
@@ -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 |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | public function start() |
55 | 55 | { |
56 | 56 | if (isset($_GET['t']) && !empty($_GET['t'])) { |
57 | - $token = $_GET['t']; |
|
57 | + $token = $_GET['t']; |
|
58 | 58 | if (isset($_GET['download'])) { |
59 | 59 | $download = (bool)$_GET['download']; |
60 | 60 | } else { |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | } |
92 | 92 | |
93 | 93 | if ($download === true || preg_match('#html#', $mime)) { |
94 | - header('Content-Disposition: attachment; filename*=UTF-8\'\'' .rawurlencode($name)); |
|
94 | + header('Content-Disposition: attachment; filename*=UTF-8\'\''.rawurlencode($name)); |
|
95 | 95 | header('Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0'); |
96 | 96 | header('Content-Type: application/octet-stream'); |
97 | 97 | header('Content-Length: '.$node->getSize()); |
@@ -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 |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | $this->logger = $logger; |
108 | 108 | $this->fs = $fs; |
109 | 109 | $this->db = $fs->getDatabase(); |
110 | - $this->pluginmgr= $fs->getPlugin(); |
|
110 | + $this->pluginmgr = $fs->getPlugin(); |
|
111 | 111 | $this->queuemgr = $fs->getQueue(); |
112 | 112 | $this->auth = $auth; |
113 | 113 |
@@ -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 |
@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | * @param bool $ignore_deleted |
184 | 184 | * @return void |
185 | 185 | */ |
186 | - public function __construct($user, Logger $logger, Filesystem $fs, bool $autocreate=false, bool $ignore_deleted=true) |
|
186 | + public function __construct($user, Logger $logger, Filesystem $fs, bool $autocreate = false, bool $ignore_deleted = true) |
|
187 | 187 | { |
188 | 188 | $this->fs = $fs; |
189 | 189 | $this->db = $fs->getDatabase(); |
@@ -197,7 +197,7 @@ discard block |
||
197 | 197 | ]); |
198 | 198 | |
199 | 199 | if ($attributes === false || $attributes === null) { |
200 | - throw new Exception('user with id ' . $user . ' does not exists'); |
|
200 | + throw new Exception('user with id '.$user.' does not exists'); |
|
201 | 201 | } |
202 | 202 | |
203 | 203 | $username = $user; |
@@ -277,7 +277,7 @@ discard block |
||
277 | 277 | * @param string|array $attribute |
278 | 278 | * @return mixed |
279 | 279 | */ |
280 | - public function getAttribute($attribute=null) |
|
280 | + public function getAttribute($attribute = null) |
|
281 | 281 | { |
282 | 282 | $valid = [ |
283 | 283 | 'id', |
@@ -352,7 +352,7 @@ discard block |
||
352 | 352 | * @param bool $string |
353 | 353 | * @return array |
354 | 354 | */ |
355 | - public function getShares(bool $string=false): array |
|
355 | + public function getShares(bool $string = false): array |
|
356 | 356 | { |
357 | 357 | $item = $this->db->storage->find([ |
358 | 358 | 'deleted' => false, |
@@ -363,7 +363,7 @@ discard block |
||
363 | 363 | 'reference' => 1, |
364 | 364 | ]); |
365 | 365 | |
366 | - $found = []; |
|
366 | + $found = []; |
|
367 | 367 | |
368 | 368 | foreach ($item as $child) { |
369 | 369 | if (isset($child['reference']) && $child['reference'] instanceof ObjectID) { |
@@ -389,7 +389,7 @@ discard block |
||
389 | 389 | * @param int $limit |
390 | 390 | * @return array |
391 | 391 | */ |
392 | - public function getNodeAttributeSummary($attributes=[], int $limit=25): array |
|
392 | + public function getNodeAttributeSummary($attributes = [], int $limit = 25): array |
|
393 | 393 | { |
394 | 394 | $mongodb = $this->db->storage; |
395 | 395 | |
@@ -427,7 +427,7 @@ discard block |
||
427 | 427 | * @param int $limit |
428 | 428 | * @return array |
429 | 429 | */ |
430 | - protected function _getAttributeSummary(string $attribute, string $type='string', int $limit=25): array |
|
430 | + protected function _getAttributeSummary(string $attribute, string $type = 'string', int $limit = 25): array |
|
431 | 431 | { |
432 | 432 | $mongodb = $this->db->storage; |
433 | 433 | |
@@ -437,7 +437,7 @@ discard block |
||
437 | 437 | '$and' => [ |
438 | 438 | ['owner' => $this->_id], |
439 | 439 | ['deleted' => false], |
440 | - [$attribute => ['$exists' => true] ] |
|
440 | + [$attribute => ['$exists' => true]] |
|
441 | 441 | ] |
442 | 442 | ] |
443 | 443 | ], |
@@ -703,7 +703,7 @@ discard block |
||
703 | 703 | * @param array $attributes |
704 | 704 | * @return bool |
705 | 705 | */ |
706 | - public function save(array $attributes=[]): bool |
|
706 | + public function save(array $attributes = []): bool |
|
707 | 707 | { |
708 | 708 | $set = []; |
709 | 709 | foreach ($attributes as $attr) { |
@@ -761,7 +761,7 @@ discard block |
||
761 | 761 | { |
762 | 762 | $quota = $this->getQuotaUsage(); |
763 | 763 | |
764 | - if (($quota['used']+$add) > $quota['hard_quota']) { |
|
764 | + if (($quota['used'] + $add) > $quota['hard_quota']) { |
|
765 | 765 | return false; |
766 | 766 | } |
767 | 767 | |
@@ -775,7 +775,7 @@ discard block |
||
775 | 775 | * @param bool $force |
776 | 776 | * @return bool |
777 | 777 | */ |
778 | - public function delete(bool $force=false): bool |
|
778 | + public function delete(bool $force = false): bool |
|
779 | 779 | { |
780 | 780 | if ($force === false) { |
781 | 781 | $result_data = $this->fs->getRoot()->delete(); |
@@ -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 |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | * @param Session $session |
63 | 63 | * @return void |
64 | 64 | */ |
65 | - public function __construct(User $user, $ttl=3600, ?Session $session=null) |
|
65 | + public function __construct(User $user, $ttl = 3600, ? Session $session = null) |
|
66 | 66 | { |
67 | 67 | $this->user = $user; |
68 | 68 |
@@ -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 |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | * @param array $session |
70 | 70 | * @return void |
71 | 71 | */ |
72 | - public function __construct(Filesystem $fs, Document $document, int $ttl=3600, $session=[]) |
|
72 | + public function __construct(Filesystem $fs, Document $document, int $ttl = 3600, $session = []) |
|
73 | 73 | { |
74 | 74 | $this->user = $fs->getUser(); |
75 | 75 | $this->fs = $fs; |