@@ -394,14 +394,14 @@ |
||
| 394 | 394 | * @throws FederatedUserNotFoundException |
| 395 | 395 | */ |
| 396 | 396 | public function importFromDatabase(array $data, string $prefix = ''): INC22QueryRow { |
| 397 | - if ($this->get($prefix . 'single_id', $data) === '') { |
|
| 397 | + if ($this->get($prefix.'single_id', $data) === '') { |
|
| 398 | 398 | throw new FederatedUserNotFoundException(); |
| 399 | 399 | } |
| 400 | 400 | |
| 401 | - $this->setSingleId($this->get($prefix . 'single_id', $data)); |
|
| 402 | - $this->setUserId($this->get($prefix . 'user_id', $data)); |
|
| 403 | - $this->setUserType($this->getInt($prefix . 'user_type', $data)); |
|
| 404 | - $this->setInstance($this->get($prefix . 'instance', $data)); |
|
| 401 | + $this->setSingleId($this->get($prefix.'single_id', $data)); |
|
| 402 | + $this->setUserId($this->get($prefix.'user_id', $data)); |
|
| 403 | + $this->setUserType($this->getInt($prefix.'user_type', $data)); |
|
| 404 | + $this->setInstance($this->get($prefix.'instance', $data)); |
|
| 405 | 405 | |
| 406 | 406 | $this->getManager()->manageImportFromDatabase($this, $data, $prefix); |
| 407 | 407 | |
@@ -50,11 +50,11 @@ discard block |
||
| 50 | 50 | |
| 51 | 51 | use TArrayTools; |
| 52 | 52 | |
| 53 | - const TYPE_UNKNOWN = 'Unknown'; // not trusted |
|
| 54 | - const TYPE_PASSIVE = 'Passive'; // Minimum information about Federated Circles are broadcasted if a member belongs to the circle. |
|
| 55 | - const TYPE_EXTERNAL = 'External'; // info about Federated Circles and their members are broadcasted if a member belongs to the circle. |
|
| 56 | - const TYPE_TRUSTED = 'Trusted'; // everything about Federated Circles are broadcasted. |
|
| 57 | - const TYPE_GLOBAL_SCALE = 'GlobalScale'; // every Circle is broadcasted, |
|
| 53 | + const TYPE_UNKNOWN = 'Unknown'; // not trusted |
|
| 54 | + const TYPE_PASSIVE = 'Passive'; // Minimum information about Federated Circles are broadcasted if a member belongs to the circle. |
|
| 55 | + const TYPE_EXTERNAL = 'External'; // info about Federated Circles and their members are broadcasted if a member belongs to the circle. |
|
| 56 | + const TYPE_TRUSTED = 'Trusted'; // everything about Federated Circles are broadcasted. |
|
| 57 | + const TYPE_GLOBAL_SCALE = 'GlobalScale'; // every Circle is broadcasted, |
|
| 58 | 58 | |
| 59 | 59 | public static $LIST_TYPE = [ |
| 60 | 60 | self::TYPE_UNKNOWN, |
@@ -432,7 +432,7 @@ discard block |
||
| 432 | 432 | ]; |
| 433 | 433 | |
| 434 | 434 | if ($this->getAuthSigned() !== '') { |
| 435 | - $data['auth-signed'] = $this->getAlgorithm() . ':' . $this->getAuthSigned(); |
|
| 435 | + $data['auth-signed'] = $this->getAlgorithm().':'.$this->getAuthSigned(); |
|
| 436 | 436 | } |
| 437 | 437 | |
| 438 | 438 | return array_filter(array_merge($data, parent::jsonSerialize())); |
@@ -447,16 +447,16 @@ discard block |
||
| 447 | 447 | * @throws RemoteNotFoundException |
| 448 | 448 | */ |
| 449 | 449 | public function importFromDatabase(array $data, string $prefix = ''): INC22QueryRow { |
| 450 | - if ($this->getInt($prefix . 'id', $data) === 0) { |
|
| 450 | + if ($this->getInt($prefix.'id', $data) === 0) { |
|
| 451 | 451 | throw new RemoteNotFoundException(); |
| 452 | 452 | } |
| 453 | 453 | |
| 454 | - $this->setDbId($this->getInt($prefix . 'id', $data)); |
|
| 455 | - $this->import($this->getArray($prefix . 'item', $data)); |
|
| 456 | - $this->setOrigData($this->getArray($prefix . 'item', $data)); |
|
| 457 | - $this->setType($this->get($prefix . 'type', $data)); |
|
| 458 | - $this->setInstance($this->get($prefix . 'instance', $data)); |
|
| 459 | - $this->setId($this->get($prefix . 'href', $data)); |
|
| 454 | + $this->setDbId($this->getInt($prefix.'id', $data)); |
|
| 455 | + $this->import($this->getArray($prefix.'item', $data)); |
|
| 456 | + $this->setOrigData($this->getArray($prefix.'item', $data)); |
|
| 457 | + $this->setType($this->get($prefix.'type', $data)); |
|
| 458 | + $this->setInstance($this->get($prefix.'instance', $data)); |
|
| 459 | + $this->setId($this->get($prefix.'href', $data)); |
|
| 460 | 460 | |
| 461 | 461 | return $this; |
| 462 | 462 | } |
@@ -190,7 +190,7 @@ |
||
| 190 | 190 | return $this->mountPoint; |
| 191 | 191 | } |
| 192 | 192 | |
| 193 | - return '/' . $this->getInitiator()->getUserId() . '/files/' . ltrim($this->mountPoint, '/'); |
|
| 193 | + return '/'.$this->getInitiator()->getUserId().'/files/'.ltrim($this->mountPoint, '/'); |
|
| 194 | 194 | } |
| 195 | 195 | |
| 196 | 196 | /** |
@@ -504,29 +504,29 @@ |
||
| 504 | 504 | * @throws FileCacheNotFoundException |
| 505 | 505 | */ |
| 506 | 506 | public function importFromDatabase(array $data, string $prefix = ''): INC22QueryRow { |
| 507 | - if ($this->getInt($prefix . 'fileid', $data) === 0) { |
|
| 507 | + if ($this->getInt($prefix.'fileid', $data) === 0) { |
|
| 508 | 508 | throw new FileCacheNotFoundException(); |
| 509 | 509 | } |
| 510 | 510 | |
| 511 | - $this->setId($this->getInt($prefix . 'fileid', $data)); |
|
| 512 | - $this->setPath($this->get($prefix . 'path', $data)); |
|
| 513 | - $this->setPermissions($this->getInt($prefix . 'permissions', $data)); |
|
| 514 | - $this->setStorageId($this->getInt($prefix . 'storage', $data)); |
|
| 515 | - $this->setPathHash($this->get($prefix . 'path_hash', $data)); |
|
| 516 | - $this->setParent($this->getInt($prefix . 'parent', $data)); |
|
| 517 | - $this->setName($this->get($prefix . 'name', $data)); |
|
| 518 | - $this->setMimeType($this->getInt($prefix . 'mimetype', $data)); |
|
| 519 | - $this->setMimePart($this->getInt($prefix . 'mimepart', $data)); |
|
| 520 | - $this->setSize($this->getInt($prefix . 'size', $data)); |
|
| 521 | - $this->setMTime($this->getInt($prefix . 'mtime', $data)); |
|
| 522 | - $this->setStorageMTime($this->getInt($prefix . 'storage_mtime', $data)); |
|
| 523 | - $this->setEncrypted($this->getBool($prefix . 'encrypted', $data)); |
|
| 524 | - $this->setUnencryptedSize($this->getInt($prefix . 'unencrypted_size', $data)); |
|
| 525 | - $this->setEtag($this->get($prefix . 'etag', $data)); |
|
| 526 | - $this->setChecksum($this->get($prefix . 'checksum', $data)); |
|
| 511 | + $this->setId($this->getInt($prefix.'fileid', $data)); |
|
| 512 | + $this->setPath($this->get($prefix.'path', $data)); |
|
| 513 | + $this->setPermissions($this->getInt($prefix.'permissions', $data)); |
|
| 514 | + $this->setStorageId($this->getInt($prefix.'storage', $data)); |
|
| 515 | + $this->setPathHash($this->get($prefix.'path_hash', $data)); |
|
| 516 | + $this->setParent($this->getInt($prefix.'parent', $data)); |
|
| 517 | + $this->setName($this->get($prefix.'name', $data)); |
|
| 518 | + $this->setMimeType($this->getInt($prefix.'mimetype', $data)); |
|
| 519 | + $this->setMimePart($this->getInt($prefix.'mimepart', $data)); |
|
| 520 | + $this->setSize($this->getInt($prefix.'size', $data)); |
|
| 521 | + $this->setMTime($this->getInt($prefix.'mtime', $data)); |
|
| 522 | + $this->setStorageMTime($this->getInt($prefix.'storage_mtime', $data)); |
|
| 523 | + $this->setEncrypted($this->getBool($prefix.'encrypted', $data)); |
|
| 524 | + $this->setUnencryptedSize($this->getInt($prefix.'unencrypted_size', $data)); |
|
| 525 | + $this->setEtag($this->get($prefix.'etag', $data)); |
|
| 526 | + $this->setChecksum($this->get($prefix.'checksum', $data)); |
|
| 527 | 527 | |
| 528 | 528 | // small hack as there is no reason to call a recursive method for a single entry from the table |
| 529 | - $this->setStorage($this->get($prefix . CoreQueryBuilder::STORAGES . '_id', $data)); |
|
| 529 | + $this->setStorage($this->get($prefix.CoreQueryBuilder::STORAGES.'_id', $data)); |
|
| 530 | 530 | |
| 531 | 531 | return $this; |
| 532 | 532 | } |
@@ -794,29 +794,29 @@ discard block |
||
| 794 | 794 | * @throws MemberNotFoundException |
| 795 | 795 | */ |
| 796 | 796 | public function importFromDatabase(array $data, string $prefix = ''): INC22QueryRow { |
| 797 | - if ($this->get($prefix . 'single_id', $data) === '') { |
|
| 797 | + if ($this->get($prefix.'single_id', $data) === '') { |
|
| 798 | 798 | throw new MemberNotFoundException(); |
| 799 | 799 | } |
| 800 | 800 | |
| 801 | - $this->setId($this->get($prefix . 'member_id', $data)); |
|
| 802 | - $this->setCircleId($this->get($prefix . 'circle_id', $data)); |
|
| 803 | - $this->setSingleId($this->get($prefix . 'single_id', $data)); |
|
| 804 | - $this->setUserId($this->get($prefix . 'user_id', $data)); |
|
| 805 | - $this->setUserType($this->getInt($prefix . 'user_type', $data)); |
|
| 806 | - $this->setInstance($this->get($prefix . 'instance', $data)); |
|
| 807 | - $this->setLevel($this->getInt($prefix . 'level', $data)); |
|
| 808 | - $this->setStatus($this->get($prefix . 'status', $data)); |
|
| 809 | - $this->setDisplayName($this->get($prefix . 'cached_name', $data)); |
|
| 810 | - $this->setNote($this->get($prefix . 'note', $data)); |
|
| 811 | - $this->setContactId($this->get($prefix . 'contact_id', $data)); |
|
| 812 | - $this->setContactMeta($this->get($prefix . 'contact_meta', $data)); |
|
| 813 | - |
|
| 814 | - $cachedUpdate = $this->get($prefix . 'cached_update', $data); |
|
| 801 | + $this->setId($this->get($prefix.'member_id', $data)); |
|
| 802 | + $this->setCircleId($this->get($prefix.'circle_id', $data)); |
|
| 803 | + $this->setSingleId($this->get($prefix.'single_id', $data)); |
|
| 804 | + $this->setUserId($this->get($prefix.'user_id', $data)); |
|
| 805 | + $this->setUserType($this->getInt($prefix.'user_type', $data)); |
|
| 806 | + $this->setInstance($this->get($prefix.'instance', $data)); |
|
| 807 | + $this->setLevel($this->getInt($prefix.'level', $data)); |
|
| 808 | + $this->setStatus($this->get($prefix.'status', $data)); |
|
| 809 | + $this->setDisplayName($this->get($prefix.'cached_name', $data)); |
|
| 810 | + $this->setNote($this->get($prefix.'note', $data)); |
|
| 811 | + $this->setContactId($this->get($prefix.'contact_id', $data)); |
|
| 812 | + $this->setContactMeta($this->get($prefix.'contact_meta', $data)); |
|
| 813 | + |
|
| 814 | + $cachedUpdate = $this->get($prefix.'cached_update', $data); |
|
| 815 | 815 | if ($cachedUpdate !== '') { |
| 816 | 816 | $this->setDisplayUpdate(DateTime::createFromFormat('Y-m-d H:i:s', $cachedUpdate)->getTimestamp()); |
| 817 | 817 | } |
| 818 | 818 | |
| 819 | - $joined = $this->get($prefix . 'joined', $data); |
|
| 819 | + $joined = $this->get($prefix.'joined', $data); |
|
| 820 | 820 | if ($joined !== '') { |
| 821 | 821 | $this->setJoined(DateTime::createFromFormat('Y-m-d H:i:s', $joined)->getTimestamp()); |
| 822 | 822 | } |
@@ -896,7 +896,7 @@ discard block |
||
| 896 | 896 | public static function parseLevelInt(int $level): int { |
| 897 | 897 | if (!array_key_exists($level, self::$DEF_LEVEL)) { |
| 898 | 898 | $all = implode(', ', array_keys(self::$DEF_LEVEL)); |
| 899 | - throw new ParseMemberLevelException('Available levels: ' . $all, 121); |
|
| 899 | + throw new ParseMemberLevelException('Available levels: '.$all, 121); |
|
| 900 | 900 | } |
| 901 | 901 | |
| 902 | 902 | return $level; |
@@ -915,7 +915,7 @@ discard block |
||
| 915 | 915 | |
| 916 | 916 | if (!$level) { |
| 917 | 917 | $all = implode(', ', array_values(self::$DEF_LEVEL)); |
| 918 | - throw new ParseMemberLevelException('Available levels: ' . $all, 121); |
|
| 918 | + throw new ParseMemberLevelException('Available levels: '.$all, 121); |
|
| 919 | 919 | } |
| 920 | 920 | |
| 921 | 921 | return (int)$level; |
@@ -933,7 +933,7 @@ discard block |
||
| 933 | 933 | |
| 934 | 934 | if ($type === false) { |
| 935 | 935 | $all = implode(', ', array_values(self::$TYPE)); |
| 936 | - throw new UserTypeNotFoundException('Available types: ' . $all); |
|
| 936 | + throw new UserTypeNotFoundException('Available types: '.$all); |
|
| 937 | 937 | } |
| 938 | 938 | |
| 939 | 939 | return (int)$type; |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | try { |
| 105 | 105 | $level = Member::parseLevelString($levelString); |
| 106 | 106 | } catch (ParseMemberLevelException $e) { |
| 107 | - throw new MemberHelperException('method ' . $levelString . ' not found'); |
|
| 107 | + throw new MemberHelperException('method '.$levelString.' not found'); |
|
| 108 | 108 | } |
| 109 | 109 | |
| 110 | 110 | $this->mustHaveLevelEqualOrAbove($level); |
@@ -122,11 +122,11 @@ discard block |
||
| 122 | 122 | try { |
| 123 | 123 | $level = Member::parseLevelString($levelString); |
| 124 | 124 | } catch (ParseMemberLevelException $e) { |
| 125 | - throw new MemberHelperException('method ' . $levelString . ' not found'); |
|
| 125 | + throw new MemberHelperException('method '.$levelString.' not found'); |
|
| 126 | 126 | } |
| 127 | 127 | |
| 128 | 128 | if ($this->member->getLevel() >= $level) { |
| 129 | - throw new MemberLevelException('Member cannot be ' . $levelString); |
|
| 129 | + throw new MemberLevelException('Member cannot be '.$levelString); |
|
| 130 | 130 | } |
| 131 | 131 | } |
| 132 | 132 | |
@@ -259,17 +259,17 @@ |
||
| 259 | 259 | * @throws MembershipNotFoundException |
| 260 | 260 | */ |
| 261 | 261 | public function importFromDatabase(array $data, string $prefix = ''): INC22QueryRow { |
| 262 | - if ($this->get($prefix . 'single_id', $data) === '') { |
|
| 262 | + if ($this->get($prefix.'single_id', $data) === '') { |
|
| 263 | 263 | throw new MembershipNotFoundException(); |
| 264 | 264 | } |
| 265 | 265 | |
| 266 | - $this->setSingleId($this->get($prefix . 'single_id', $data)); |
|
| 267 | - $this->setCircleId($this->get($prefix . 'circle_id', $data)); |
|
| 268 | - $this->setLevel($this->getInt($prefix . 'level', $data)); |
|
| 269 | - $this->setInheritanceFirst($this->get($prefix . 'inheritance_first', $data)); |
|
| 270 | - $this->setInheritanceLast($this->get($prefix . 'inheritance_last', $data)); |
|
| 271 | - $this->setInheritancePath($this->getArray($prefix . 'inheritance_path', $data)); |
|
| 272 | - $this->setInheritanceDepth($this->getInt($prefix . 'inheritance_depth', $data)); |
|
| 266 | + $this->setSingleId($this->get($prefix.'single_id', $data)); |
|
| 267 | + $this->setCircleId($this->get($prefix.'circle_id', $data)); |
|
| 268 | + $this->setLevel($this->getInt($prefix.'level', $data)); |
|
| 269 | + $this->setInheritanceFirst($this->get($prefix.'inheritance_first', $data)); |
|
| 270 | + $this->setInheritanceLast($this->get($prefix.'inheritance_last', $data)); |
|
| 271 | + $this->setInheritancePath($this->getArray($prefix.'inheritance_path', $data)); |
|
| 272 | + $this->setInheritanceDepth($this->getInt($prefix.'inheritance_depth', $data)); |
|
| 273 | 273 | |
| 274 | 274 | return $this; |
| 275 | 275 | } |
@@ -125,7 +125,7 @@ |
||
| 125 | 125 | } catch (FederatedItemException $e) { |
| 126 | 126 | if ($input->getOption('status-code')) { |
| 127 | 127 | throw new FederatedItemException( |
| 128 | - ' [' . get_class($e) . ', ' . $e->getStatus() . ']' . "\n" . $e->getMessage() |
|
| 128 | + ' ['.get_class($e).', '.$e->getStatus().']'."\n".$e->getMessage() |
|
| 129 | 129 | ); |
| 130 | 130 | } |
| 131 | 131 | |
@@ -125,7 +125,7 @@ |
||
| 125 | 125 | } catch (FederatedItemException $e) { |
| 126 | 126 | if ($input->getOption('status-code')) { |
| 127 | 127 | throw new FederatedItemException( |
| 128 | - ' [' . get_class($e) . ', ' . $e->getStatus() . ']' . "\n" . $e->getMessage() |
|
| 128 | + ' ['.get_class($e).', '.$e->getStatus().']'."\n".$e->getMessage() |
|
| 129 | 129 | ); |
| 130 | 130 | } |
| 131 | 131 | |