@@ -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 |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | * @param Logger $logger |
75 | 75 | * @return void |
76 | 76 | */ |
77 | - public function __construct(?Iterable $config, Logger $logger) |
|
77 | + public function __construct(? Iterable $config, Logger $logger) |
|
78 | 78 | { |
79 | 79 | $this->logger = $logger; |
80 | 80 | $this->setOptions($config); |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | * @param Iterable |
110 | 110 | * @return Ldap |
111 | 111 | */ |
112 | - public function setOptions(?Iterable $config): LdapServer |
|
112 | + public function setOptions(? Iterable $config) : LdapServer |
|
113 | 113 | { |
114 | 114 | if ($config === null) { |
115 | 115 | 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 |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | * @param Logger $logger |
32 | 32 | * @return void |
33 | 33 | */ |
34 | - public function __construct(?Iterable $config, Logger $logger) |
|
34 | + public function __construct(? Iterable $config, Logger $logger) |
|
35 | 35 | { |
36 | 36 | } |
37 | 37 | |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | * |
42 | 42 | * @return int |
43 | 43 | */ |
44 | - public function getAttributeSyncCache(): int |
|
44 | + public function getAttributeSyncCache() : int |
|
45 | 45 | { |
46 | 46 | return -1; |
47 | 47 | } |
@@ -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 |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | * @param Iterable $config |
41 | 41 | * @return LdapServer |
42 | 42 | */ |
43 | - public function setOptions(?Iterable $config): LdapServer |
|
43 | + public function setOptions(? Iterable $config) : LdapServer |
|
44 | 44 | { |
45 | 45 | if ($config === null) { |
46 | 46 | return $this; |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | */ |
109 | 109 | public function preauth(string $value): bool |
110 | 110 | { |
111 | - $parts = explode('|', $value); |
|
111 | + $parts = explode('|', $value); |
|
112 | 112 | |
113 | 113 | if (count($parts) !== 2) { |
114 | 114 | $this->logger->warning('invalid header x-preauth value, parts != 2', [ |
@@ -195,7 +195,7 @@ discard block |
||
195 | 195 | 'category' => get_class($this) |
196 | 196 | ]); |
197 | 197 | |
198 | - $this->ldap_dn = $dn; |
|
198 | + $this->ldap_dn = $dn; |
|
199 | 199 | |
200 | 200 | return true; |
201 | 201 | } |
@@ -220,6 +220,6 @@ discard block |
||
220 | 220 | $ip_decimal = ip2long($ip); |
221 | 221 | $wildcard_decimal = pow(2, (32 - $netmask)) - 1; |
222 | 222 | $netmask_decimal = ~ $wildcard_decimal; |
223 | - return (($ip_decimal & $netmask_decimal) == ($range_decimal & $netmask_decimal)); |
|
223 | + return (($ip_decimal&$netmask_decimal) == ($range_decimal&$netmask_decimal)); |
|
224 | 224 | } |
225 | 225 | } |
@@ -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 |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | * @param Logger $logger |
24 | 24 | * @return void |
25 | 25 | */ |
26 | - public function __construct(?Iterable $config, Logger $logger); |
|
26 | + public function __construct(? Iterable $config, Logger $logger); |
|
27 | 27 | |
28 | 28 | |
29 | 29 | /** |
@@ -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 |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | * @param Logger $logger |
98 | 98 | * @return void |
99 | 99 | */ |
100 | - public function __construct(?Iterable $config, Logger $logger) |
|
100 | + public function __construct(? Iterable $config, Logger $logger) |
|
101 | 101 | { |
102 | 102 | $this->logger = $logger; |
103 | 103 | $this->setOptions($config); |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | * @param Iterable |
111 | 111 | * @return Oauth2 |
112 | 112 | */ |
113 | - public function setOptions(?Iterable $config): Oauth2 |
|
113 | + public function setOptions(? Iterable $config) : Oauth2 |
|
114 | 114 | { |
115 | 115 | if ($config === null) { |
116 | 116 | return $this; |
@@ -266,9 +266,9 @@ discard block |
||
266 | 266 | $jre = json_decode($re); |
267 | 267 | |
268 | 268 | if ($jre->status == "success") { |
269 | - return (array) $jre->data; |
|
269 | + return (array)$jre->data; |
|
270 | 270 | } elseif ($jre->status == "fail") { |
271 | - throw new Exception('Error while validating the acces token. Auth server responded: ' . $jre->message); |
|
271 | + throw new Exception('Error while validating the acces token. Auth server responded: '.$jre->message); |
|
272 | 272 | } else { |
273 | 273 | throw new Exception('could not decode response: '.$re); |
274 | 274 | } |
@@ -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 |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | * @param Iterable $config |
42 | 42 | * @return void |
43 | 43 | */ |
44 | - public function __construct(Logger $logger, ?Iterable $config) |
|
44 | + public function __construct(Logger $logger, ? Iterable $config) |
|
45 | 45 | { |
46 | 46 | $this->logger = $logger; |
47 | 47 | $this->addConverter($config); |
@@ -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 | * @param string $cursor |
86 | 86 | * @return array |
87 | 87 | */ |
88 | - protected function decodeCursor(?string $cursor): ?array |
|
88 | + protected function decodeCursor(? string $cursor) : ? array |
|
89 | 89 | { |
90 | 90 | if ($cursor === null) { |
91 | 91 | return null; |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | * @param INode $node |
116 | 116 | * @return array |
117 | 117 | */ |
118 | - public function buildFeedFromCurrentState(?array $cursor=null, int $limit=100, array $attributes=[], ?INode $node=null): array |
|
118 | + public function buildFeedFromCurrentState(? array $cursor = null, int $limit = 100, array $attributes = [], ? INode $node = null) : array |
|
119 | 119 | { |
120 | 120 | $current_cursor = 0; |
121 | 121 | $filter = ['$and' => [ |
@@ -153,7 +153,7 @@ discard block |
||
153 | 153 | $ts = $last['timestamp']; |
154 | 154 | } |
155 | 155 | |
156 | - $reset = true; |
|
156 | + $reset = true; |
|
157 | 157 | if ($has_more === false) { |
158 | 158 | $cursor = base64_encode('delta|0|0|'.$delta_id.'|'.$ts); |
159 | 159 | } else { |
@@ -201,7 +201,7 @@ discard block |
||
201 | 201 | * @param INode $node |
202 | 202 | * @return BSONDocument |
203 | 203 | */ |
204 | - public function getLastRecord(?INode $node=null): ?BSONDocument |
|
204 | + public function getLastRecord(? INode $node = null) : ? BSONDocument |
|
205 | 205 | { |
206 | 206 | $filter = $this->getDeltaFilter(); |
207 | 207 | |
@@ -227,7 +227,7 @@ discard block |
||
227 | 227 | * @param INode $node |
228 | 228 | * @return string |
229 | 229 | */ |
230 | - public function getLastCursor(?INode $node=null): string |
|
230 | + public function getLastCursor(? INode $node = null) : string |
|
231 | 231 | { |
232 | 232 | $filter = $this->getDeltaFilter(); |
233 | 233 | |
@@ -259,11 +259,11 @@ discard block |
||
259 | 259 | * @param INode $node |
260 | 260 | * @return array |
261 | 261 | */ |
262 | - public function getDeltaFeed(?string $cursor=null, int $limit=250, array $attributes=[], ?INode $node=null): array |
|
262 | + public function getDeltaFeed(? string $cursor = null, int $limit = 250, array $attributes = [], ? INode $node = null) : array |
|
263 | 263 | { |
264 | 264 | $this->user->findNewShares(); |
265 | 265 | |
266 | - $attributes = array_merge(['id', 'directory', 'deleted', 'path', 'changed', 'created', 'owner'], |
|
266 | + $attributes = array_merge(['id', 'directory', 'deleted', 'path', 'changed', 'created', 'owner'], |
|
267 | 267 | $attributes); |
268 | 268 | |
269 | 269 | $cursor = $this->decodeCursor($cursor); |
@@ -429,7 +429,7 @@ discard block |
||
429 | 429 | * @param INode $node |
430 | 430 | * @return array |
431 | 431 | */ |
432 | - public function getEventLog(int $limit=100, int $skip=0, ?INode $node=null): array |
|
432 | + public function getEventLog(int $limit = 100, int $skip = 0, ? INode $node = null) : array |
|
433 | 433 | { |
434 | 434 | $filter = $this->getDeltaFilter(); |
435 | 435 | |
@@ -456,7 +456,7 @@ discard block |
||
456 | 456 | |
457 | 457 | $events = []; |
458 | 458 | foreach ($result as $log) { |
459 | - $id = (string)$log['_id']; |
|
459 | + $id = (string)$log['_id']; |
|
460 | 460 | $events[$id] = [ |
461 | 461 | 'event' => $id, |
462 | 462 | 'timestamp' => Helper::DateTimeToUnix($log['timestamp']), |
@@ -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 |
@@ -221,7 +221,7 @@ discard block |
||
221 | 221 | * @param Filesystem $fs |
222 | 222 | * @return void |
223 | 223 | */ |
224 | - public function __construct(?BSONDocument $node, Filesystem $fs) |
|
224 | + public function __construct(? BSONDocument $node, Filesystem $fs) |
|
225 | 225 | { |
226 | 226 | $this->_fs = $fs; |
227 | 227 | $this->_db = $fs->getDatabase(); |
@@ -269,7 +269,7 @@ discard block |
||
269 | 269 | * |
270 | 270 | * @return mixed |
271 | 271 | */ |
272 | - public function __call(string $attribute, array $params=[]) |
|
272 | + public function __call(string $attribute, array $params = []) |
|
273 | 273 | { |
274 | 274 | $prefix = 'get'; |
275 | 275 | $attr = strtolower(substr($attribute, 3)); |
@@ -314,7 +314,7 @@ discard block |
||
314 | 314 | * @param int $conflict |
315 | 315 | * @return INode |
316 | 316 | */ |
317 | - public function setParent(Collection $parent, int $conflict=INode::CONFLICT_NOACTION): INode |
|
317 | + public function setParent(Collection $parent, int $conflict = INode::CONFLICT_NOACTION): INode |
|
318 | 318 | { |
319 | 319 | if ($this->parent === $parent->getId()) { |
320 | 320 | throw new Exception\Conflict('source node '.$this->name.' is already in the requested parent folder', |
@@ -389,7 +389,7 @@ discard block |
||
389 | 389 | * @param bool $recursion_first |
390 | 390 | * @return INode |
391 | 391 | */ |
392 | - abstract public function copyTo(Collection $parent, int $conflict=INode::CONFLICT_NOACTION, ?string $recursion=null, bool $recursion_first=true): INode; |
|
392 | + abstract public function copyTo(Collection $parent, int $conflict = INode::CONFLICT_NOACTION, ? string $recursion = null, bool $recursion_first = true) : INode; |
|
393 | 393 | |
394 | 394 | |
395 | 395 | /** |
@@ -398,7 +398,7 @@ discard block |
||
398 | 398 | * @param bool $reference |
399 | 399 | * @return ObjectId |
400 | 400 | */ |
401 | - public function getShareId(bool $reference=false): ?ObjectId |
|
401 | + public function getShareId(bool $reference = false): ? ObjectId |
|
402 | 402 | { |
403 | 403 | if ($this->isReference() && $reference === true) { |
404 | 404 | return $this->_id; |
@@ -446,7 +446,7 @@ discard block |
||
446 | 446 | * @param bool $reference |
447 | 447 | * @return Collection |
448 | 448 | */ |
449 | - public function getShareNode(): ?Collection |
|
449 | + public function getShareNode(): ? Collection |
|
450 | 450 | { |
451 | 451 | if ($this->isSpecial()) { |
452 | 452 | return $this->_fs->findNodeWithId($this->getShareId(true)); |
@@ -594,7 +594,7 @@ discard block |
||
594 | 594 | * @param string $privilege |
595 | 595 | * @return bool |
596 | 596 | */ |
597 | - public function isAllowed(string $privilege='r'): bool |
|
597 | + public function isAllowed(string $privilege = 'r'): bool |
|
598 | 598 | { |
599 | 599 | $acl = null; |
600 | 600 | $share = null; |
@@ -788,7 +788,7 @@ discard block |
||
788 | 788 | $clean[] = 'meta'; |
789 | 789 | } |
790 | 790 | |
791 | - $attribute = $clean; |
|
791 | + $attribute = $clean; |
|
792 | 792 | |
793 | 793 | try { |
794 | 794 | $sharenode = $this->getShareNode(); |
@@ -918,7 +918,7 @@ discard block |
||
918 | 918 | * @param string $name |
919 | 919 | * @return string |
920 | 920 | */ |
921 | - protected function _getDuplicateName(?string $name=null): string |
|
921 | + protected function _getDuplicateName(? string $name = null) : string |
|
922 | 922 | { |
923 | 923 | if ($name === null) { |
924 | 924 | $name = $this->name; |
@@ -927,7 +927,7 @@ discard block |
||
927 | 927 | if ($this instanceof Collection) { |
928 | 928 | return $name.' ('.substr(uniqid('', true), -4).')'; |
929 | 929 | } else { |
930 | - $ext = substr(strrchr($name, '.'), 1); |
|
930 | + $ext = substr(strrchr($name, '.'), 1); |
|
931 | 931 | |
932 | 932 | if ($ext === false) { |
933 | 933 | return $name.' ('.substr(uniqid('', true), -4).')'; |
@@ -947,7 +947,7 @@ discard block |
||
947 | 947 | * @param bool $recursion_first |
948 | 948 | * @return bool |
949 | 949 | */ |
950 | - public function undelete(int $conflict=INode::CONFLICT_NOACTION, ?string $recursion=null, bool $recursion_first=true): bool |
|
950 | + public function undelete(int $conflict = INode::CONFLICT_NOACTION, ? string $recursion = null, bool $recursion_first = true) : bool |
|
951 | 951 | { |
952 | 952 | if (!$this->isAllowed('w')) { |
953 | 953 | throw new Exception\Forbidden('not allowed to restore node '.$this->name, |
@@ -987,7 +987,7 @@ discard block |
||
987 | 987 | $recursion_first = false; |
988 | 988 | } |
989 | 989 | |
990 | - $this->deleted = false; |
|
990 | + $this->deleted = false; |
|
991 | 991 | |
992 | 992 | if ($this instanceof File) { |
993 | 993 | $current = $this->version; |
@@ -1141,7 +1141,7 @@ discard block |
||
1141 | 1141 | * |
1142 | 1142 | * @return ObjectId|string |
1143 | 1143 | */ |
1144 | - public function getId(bool $string=false) |
|
1144 | + public function getId(bool $string = false) |
|
1145 | 1145 | { |
1146 | 1146 | if ($string === true) { |
1147 | 1147 | return (string)$this->_id; |
@@ -1156,7 +1156,7 @@ discard block |
||
1156 | 1156 | * |
1157 | 1157 | * @return Collection |
1158 | 1158 | */ |
1159 | - public function getParent(): ?Collection |
|
1159 | + public function getParent(): ? Collection |
|
1160 | 1160 | { |
1161 | 1161 | try { |
1162 | 1162 | if ($this->isRoot()) { |
@@ -1191,7 +1191,7 @@ discard block |
||
1191 | 1191 | * @param array $parents |
1192 | 1192 | * @return array |
1193 | 1193 | */ |
1194 | - public function getParents(?INode $node=null, array $parents=[]): array |
|
1194 | + public function getParents(? INode $node = null, array $parents = []) : array |
|
1195 | 1195 | { |
1196 | 1196 | if ($node === null) { |
1197 | 1197 | $node = $this; |
@@ -1258,7 +1258,7 @@ discard block |
||
1258 | 1258 | * @param int $depth |
1259 | 1259 | * @return bool |
1260 | 1260 | */ |
1261 | - public function zip(ZipStream $archive, bool $self=true, ?INode $parent=null, string $path='', int $depth=0): bool |
|
1261 | + public function zip(ZipStream $archive, bool $self = true, ? INode $parent = null, string $path = '', int $depth = 0) : bool |
|
1262 | 1262 | { |
1263 | 1263 | if ($parent === null) { |
1264 | 1264 | $parent = $this; |
@@ -1320,7 +1320,7 @@ discard block |
||
1320 | 1320 | * @param mixed $value |
1321 | 1321 | * @return INode |
1322 | 1322 | */ |
1323 | - public function setMetaAttribute($attributes, $value=null): INode |
|
1323 | + public function setMetaAttribute($attributes, $value = null): INode |
|
1324 | 1324 | { |
1325 | 1325 | $this->meta = self::validateMetaAttribute($attributes, $value, $this->meta); |
1326 | 1326 | $this->save('meta'); |
@@ -1336,7 +1336,7 @@ discard block |
||
1336 | 1336 | * @param array $set |
1337 | 1337 | * @return array |
1338 | 1338 | */ |
1339 | - public static function validateMetaAttribute($attributes, $value=null, array $set=[]): array |
|
1339 | + public static function validateMetaAttribute($attributes, $value = null, array $set = []): array |
|
1340 | 1340 | { |
1341 | 1341 | if (is_string($attributes)) { |
1342 | 1342 | $attributes = [ |
@@ -1367,7 +1367,7 @@ discard block |
||
1367 | 1367 | * @param string|array $attribute Specify attributes to return |
1368 | 1368 | * @return string|array |
1369 | 1369 | */ |
1370 | - public function getMetaAttribute($attribute=[]) |
|
1370 | + public function getMetaAttribute($attribute = []) |
|
1371 | 1371 | { |
1372 | 1372 | if (is_string($attribute)) { |
1373 | 1373 | if (isset($this->meta[$attribute])) { |
@@ -1387,7 +1387,7 @@ discard block |
||
1387 | 1387 | * @param bool $readonly |
1388 | 1388 | * @return bool |
1389 | 1389 | */ |
1390 | - public function setReadonly(bool $readonly=true): bool |
|
1390 | + public function setReadonly(bool $readonly = true): bool |
|
1391 | 1391 | { |
1392 | 1392 | $this->readonly = $readonly; |
1393 | 1393 | return $this->save('readonly'); |
@@ -1400,7 +1400,7 @@ discard block |
||
1400 | 1400 | * @param UTCDateTime $ts |
1401 | 1401 | * @return bool |
1402 | 1402 | */ |
1403 | - public function setDestroyable(?UTCDateTime $ts): bool |
|
1403 | + public function setDestroyable(? UTCDateTime $ts) : bool |
|
1404 | 1404 | { |
1405 | 1405 | $this->destroy = $ts; |
1406 | 1406 | |
@@ -1423,7 +1423,7 @@ discard block |
||
1423 | 1423 | * @param string $recursion |
1424 | 1424 | * @return bool |
1425 | 1425 | */ |
1426 | - abstract public function delete(bool $force=false, ?string $recursion=null, bool $recursion_first=true): bool; |
|
1426 | + abstract public function delete(bool $force = false, ? string $recursion = null, bool $recursion_first = true) : bool; |
|
1427 | 1427 | |
1428 | 1428 | |
1429 | 1429 | /** |
@@ -1493,7 +1493,7 @@ discard block |
||
1493 | 1493 | * @param bool $recursion_first |
1494 | 1494 | * @return bool |
1495 | 1495 | */ |
1496 | - public function save($attributes=[], $remove=[], ?string $recursion=null, bool $recursion_first=true): bool |
|
1496 | + public function save($attributes = [], $remove = [], ? string $recursion = null, bool $recursion_first = true) : bool |
|
1497 | 1497 | { |
1498 | 1498 | if (!$this->isAllowed('w') && !$this->isReference()) { |
1499 | 1499 | throw new Exception\Forbidden('not allowed to modify node '.$this->name, |
@@ -1526,7 +1526,7 @@ discard block |
||
1526 | 1526 | if (empty($update)) { |
1527 | 1527 | return false; |
1528 | 1528 | } else { |
1529 | - $result =$this->_db->storage->updateOne([ |
|
1529 | + $result = $this->_db->storage->updateOne([ |
|
1530 | 1530 | '_id' => $this->_id, |
1531 | 1531 | ], $update); |
1532 | 1532 | } |
@@ -1562,11 +1562,11 @@ discard block |
||
1562 | 1562 | * @return array |
1563 | 1563 | */ |
1564 | 1564 | public static function loadNodeAttributesWithCustomFilter( |
1565 | - ?array $filter = null, |
|
1565 | + ? array $filter = null, |
|
1566 | 1566 | array $attributes = ['_id'], |
1567 | - ?int $limit = null, |
|
1568 | - ?int &$cursor = null, |
|
1569 | - ?bool &$has_more = null) |
|
1567 | + ? int $limit = null, |
|
1568 | + ? int&$cursor = null, |
|
1569 | + ? bool&$has_more = null) |
|
1570 | 1570 | { |
1571 | 1571 | $default = [ |
1572 | 1572 | '_id' => 1, |
@@ -1578,7 +1578,7 @@ discard block |
||
1578 | 1578 | |
1579 | 1579 | $search_attributes = array_merge($default, array_fill_keys($attributes, 1)); |
1580 | 1580 | $list = []; |
1581 | - $result =$this->_db->storage->find($filter, [ |
|
1581 | + $result = $this->_db->storage->find($filter, [ |
|
1582 | 1582 | 'skip' => $cursor, |
1583 | 1583 | 'limit' => $limit, |
1584 | 1584 | 'projection'=> $search_attributes |
@@ -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 |
@@ -47,14 +47,14 @@ discard block |
||
47 | 47 | * @param array |
48 | 48 | **/ |
49 | 49 | protected $temp_files = [ |
50 | - '/^\._(.*)$/', // OS/X resource forks |
|
51 | - '/^.DS_Store$/', // OS/X custom folder settings |
|
50 | + '/^\._(.*)$/', // OS/X resource forks |
|
51 | + '/^.DS_Store$/', // OS/X custom folder settings |
|
52 | 52 | '/^desktop.ini$/', // Windows custom folder settings |
53 | - '/^Thumbs.db$/', // Windows thumbnail cache |
|
54 | - '/^.(.*).swpx$/', // ViM temporary files |
|
55 | - '/^.(.*).swx$/', // ViM temporary files |
|
56 | - '/^.(.*).swp$/', // ViM temporary files |
|
57 | - '/^\.dat(.*)$/', // Smultron seems to create these |
|
53 | + '/^Thumbs.db$/', // Windows thumbnail cache |
|
54 | + '/^.(.*).swpx$/', // ViM temporary files |
|
55 | + '/^.(.*).swx$/', // ViM temporary files |
|
56 | + '/^.(.*).swp$/', // ViM temporary files |
|
57 | + '/^\.dat(.*)$/', // Smultron seems to create these |
|
58 | 58 | '/^~lock.(.*)#$/', // Windows 7 lockfiles |
59 | 59 | ]; |
60 | 60 | |
@@ -159,7 +159,7 @@ discard block |
||
159 | 159 | * @param bool $recursion_first |
160 | 160 | * @return INode |
161 | 161 | */ |
162 | - public function copyTo(Collection $parent, int $conflict=INode::CONFLICT_NOACTION, ?string $recursion=null, bool $recursion_first=true): INode |
|
162 | + public function copyTo(Collection $parent, int $conflict = INode::CONFLICT_NOACTION, ? string $recursion = null, bool $recursion_first = true) : INode |
|
163 | 163 | { |
164 | 164 | $this->_pluginmgr->run('preCopyFile', |
165 | 165 | [$this, $parent, &$conflict, &$recursion, &$recursion_first] |
@@ -316,7 +316,7 @@ discard block |
||
316 | 316 | * @param bool $recursion_first |
317 | 317 | * @return bool |
318 | 318 | */ |
319 | - public function delete(bool $force=false, ?string $recursion=null, bool $recursion_first=true): bool |
|
319 | + public function delete(bool $force = false, ? string $recursion = null, bool $recursion_first = true) : bool |
|
320 | 320 | { |
321 | 321 | if (!$this->isAllowed('w')) { |
322 | 322 | throw new Exception\Forbidden('not allowed to delete node '.$this->name, |
@@ -339,7 +339,7 @@ discard block |
||
339 | 339 | } |
340 | 340 | |
341 | 341 | $ts = new UTCDateTime(); |
342 | - $this->deleted = $ts; |
|
342 | + $this->deleted = $ts; |
|
343 | 343 | $this->increaseVersion(); |
344 | 344 | |
345 | 345 | $this->history[] = [ |
@@ -434,7 +434,7 @@ discard block |
||
434 | 434 | return true; |
435 | 435 | } |
436 | 436 | |
437 | - $ref = $file['metadata']['ref']; |
|
437 | + $ref = $file['metadata']['ref']; |
|
438 | 438 | |
439 | 439 | $found = false; |
440 | 440 | foreach ($ref as $key => $node) { |
@@ -573,7 +573,7 @@ discard block |
||
573 | 573 | * @param string|array $attribute |
574 | 574 | * @return array|string |
575 | 575 | */ |
576 | - public function getAttribute($attribute=[]) |
|
576 | + public function getAttribute($attribute = []) |
|
577 | 577 | { |
578 | 578 | if (empty($attribute)) { |
579 | 579 | $attribute = [ |
@@ -892,8 +892,8 @@ discard block |
||
892 | 892 | { |
893 | 893 | assert(strlen($data) == 16); |
894 | 894 | |
895 | - $data[6] = chr(ord($data[6]) & 0x0f | 0x40); // set version to 0100 |
|
896 | - $data[8] = chr(ord($data[8]) & 0x3f | 0x80); // set bits 6-7 to 10 |
|
895 | + $data[6] = chr(ord($data[6])&0x0f|0x40); // set version to 0100 |
|
896 | + $data[8] = chr(ord($data[8])&0x3f|0x80); // set bits 6-7 to 10 |
|
897 | 897 | |
898 | 898 | return vsprintf('%s%s-%s-%s-%s-%s%s%s', str_split(bin2hex($data), 4)); |
899 | 899 | } |
@@ -917,7 +917,7 @@ discard block |
||
917 | 917 | * @param array $attributes |
918 | 918 | * @return int |
919 | 919 | */ |
920 | - public function put($file, bool $new=false, array $attributes=[]): int |
|
920 | + public function put($file, bool $new = false, array $attributes = []): int |
|
921 | 921 | { |
922 | 922 | $this->_logger->debug('PUT new content data for ['.$this->_id.']', [ |
923 | 923 | 'category' => get_class($this), |
@@ -968,7 +968,7 @@ discard block |
||
968 | 968 | ); |
969 | 969 | } |
970 | 970 | |
971 | - $file = $tmp_file; |
|
971 | + $file = $tmp_file; |
|
972 | 972 | } |
973 | 973 | |
974 | 974 | |
@@ -1036,7 +1036,7 @@ discard block |
||
1036 | 1036 | $this->mime = $attributes['mime']; |
1037 | 1037 | } elseif ($file !== null) { |
1038 | 1038 | $finfo = finfo_open(FILEINFO_MIME_TYPE); |
1039 | - $this->mime = finfo_file($finfo, $file); |
|
1039 | + $this->mime = finfo_file($finfo, $file); |
|
1040 | 1040 | if ($this->mime == 'application/zip' || $this->mime == 'application/vnd.ms-office') { |
1041 | 1041 | $this->mime = $this->getMimeTypeFromExtension($this->name); |
1042 | 1042 | } |
@@ -1129,7 +1129,7 @@ discard block |
||
1129 | 1129 | * @param string $db mimetypes |
1130 | 1130 | * @return string |
1131 | 1131 | */ |
1132 | - public function getMimeTypeFromExtension(string $filename, string $db='/etc/mime.types'): string |
|
1132 | + public function getMimeTypeFromExtension(string $filename, string $db = '/etc/mime.types'): string |
|
1133 | 1133 | { |
1134 | 1134 | if (!is_readable($db)) { |
1135 | 1135 | throw new Exception('mime database '.$db.' was not found or is not readable'); |
@@ -1146,7 +1146,7 @@ discard block |
||
1146 | 1146 | if (substr($line, 0, 1) == '#') { |
1147 | 1147 | continue; |
1148 | 1148 | } // skip comments |
1149 | - $line = rtrim($line) . " "; |
|
1149 | + $line = rtrim($line)." "; |
|
1150 | 1150 | if (!preg_match($regex, $line, $matches)) { |
1151 | 1151 | continue; |
1152 | 1152 | } // no match to the extension |