@@ -848,29 +848,29 @@ discard block |
||
848 | 848 | * @throws MemberNotFoundException |
849 | 849 | */ |
850 | 850 | public function importFromDatabase(array $data, string $prefix = ''): IQueryRow { |
851 | - if ($this->get($prefix . 'single_id', $data) === '') { |
|
851 | + if ($this->get($prefix.'single_id', $data) === '') { |
|
852 | 852 | throw new MemberNotFoundException(); |
853 | 853 | } |
854 | 854 | |
855 | - $this->setId($this->get($prefix . 'member_id', $data)); |
|
856 | - $this->setCircleId($this->get($prefix . 'circle_id', $data)); |
|
857 | - $this->setSingleId($this->get($prefix . 'single_id', $data)); |
|
858 | - $this->setUserId($this->get($prefix . 'user_id', $data)); |
|
859 | - $this->setUserType($this->getInt($prefix . 'user_type', $data)); |
|
860 | - $this->setInstance($this->get($prefix . 'instance', $data)); |
|
861 | - $this->setLevel($this->getInt($prefix . 'level', $data)); |
|
862 | - $this->setStatus($this->get($prefix . 'status', $data)); |
|
863 | - $this->setDisplayName($this->get($prefix . 'cached_name', $data)); |
|
864 | - $this->setNotes($this->getArray($prefix . 'note', $data)); |
|
865 | - $this->setContactId($this->get($prefix . 'contact_id', $data)); |
|
866 | - $this->setContactMeta($this->get($prefix . 'contact_meta', $data)); |
|
867 | - |
|
868 | - $cachedUpdate = $this->get($prefix . 'cached_update', $data); |
|
855 | + $this->setId($this->get($prefix.'member_id', $data)); |
|
856 | + $this->setCircleId($this->get($prefix.'circle_id', $data)); |
|
857 | + $this->setSingleId($this->get($prefix.'single_id', $data)); |
|
858 | + $this->setUserId($this->get($prefix.'user_id', $data)); |
|
859 | + $this->setUserType($this->getInt($prefix.'user_type', $data)); |
|
860 | + $this->setInstance($this->get($prefix.'instance', $data)); |
|
861 | + $this->setLevel($this->getInt($prefix.'level', $data)); |
|
862 | + $this->setStatus($this->get($prefix.'status', $data)); |
|
863 | + $this->setDisplayName($this->get($prefix.'cached_name', $data)); |
|
864 | + $this->setNotes($this->getArray($prefix.'note', $data)); |
|
865 | + $this->setContactId($this->get($prefix.'contact_id', $data)); |
|
866 | + $this->setContactMeta($this->get($prefix.'contact_meta', $data)); |
|
867 | + |
|
868 | + $cachedUpdate = $this->get($prefix.'cached_update', $data); |
|
869 | 869 | if ($cachedUpdate !== '') { |
870 | 870 | $this->setDisplayUpdate(DateTime::createFromFormat('Y-m-d H:i:s', $cachedUpdate)->getTimestamp()); |
871 | 871 | } |
872 | 872 | |
873 | - $joined = $this->get($prefix . 'joined', $data); |
|
873 | + $joined = $this->get($prefix.'joined', $data); |
|
874 | 874 | if ($joined !== '') { |
875 | 875 | $this->setJoined(DateTime::createFromFormat('Y-m-d H:i:s', $joined)->getTimestamp()); |
876 | 876 | } |
@@ -961,7 +961,7 @@ discard block |
||
961 | 961 | public static function parseLevelInt(int $level): int { |
962 | 962 | if (!array_key_exists($level, self::$DEF_LEVEL)) { |
963 | 963 | $all = implode(', ', array_keys(self::$DEF_LEVEL)); |
964 | - throw new ParseMemberLevelException('Available levels: ' . $all, 121); |
|
964 | + throw new ParseMemberLevelException('Available levels: '.$all, 121); |
|
965 | 965 | } |
966 | 966 | |
967 | 967 | return $level; |
@@ -980,7 +980,7 @@ discard block |
||
980 | 980 | |
981 | 981 | if (!$level) { |
982 | 982 | $all = implode(', ', array_values(self::$DEF_LEVEL)); |
983 | - throw new ParseMemberLevelException('Available levels: ' . $all, 121); |
|
983 | + throw new ParseMemberLevelException('Available levels: '.$all, 121); |
|
984 | 984 | } |
985 | 985 | |
986 | 986 | return (int)$level; |
@@ -1001,7 +1001,7 @@ discard block |
||
1001 | 1001 | $type = array_search($typeString, Member::$TYPE); |
1002 | 1002 | if ($type === false) { |
1003 | 1003 | $all = implode(', ', array_values(self::$TYPE)); |
1004 | - throw new UserTypeNotFoundException('Available types: ' . $all); |
|
1004 | + throw new UserTypeNotFoundException('Available types: '.$all); |
|
1005 | 1005 | } |
1006 | 1006 | |
1007 | 1007 | return (int)$type; |
@@ -418,15 +418,15 @@ |
||
418 | 418 | * @throws FederatedUserNotFoundException |
419 | 419 | */ |
420 | 420 | public function importFromDatabase(array $data, string $prefix = ''): IQueryRow { |
421 | - if ($this->get($prefix . 'single_id', $data) === '') { |
|
421 | + if ($this->get($prefix.'single_id', $data) === '') { |
|
422 | 422 | throw new FederatedUserNotFoundException(); |
423 | 423 | } |
424 | 424 | |
425 | - $this->setSingleId($this->get($prefix . 'single_id', $data)); |
|
426 | - $this->setUserId($this->get($prefix . 'user_id', $data)); |
|
427 | - $this->setUserType($this->getInt($prefix . 'user_type', $data)); |
|
428 | - $this->setDisplayName($this->get($prefix . 'cached_name', $data)); |
|
429 | - $this->setInstance($this->get($prefix . 'instance', $data)); |
|
425 | + $this->setSingleId($this->get($prefix.'single_id', $data)); |
|
426 | + $this->setUserId($this->get($prefix.'user_id', $data)); |
|
427 | + $this->setUserType($this->getInt($prefix.'user_type', $data)); |
|
428 | + $this->setDisplayName($this->get($prefix.'cached_name', $data)); |
|
429 | + $this->setInstance($this->get($prefix.'instance', $data)); |
|
430 | 430 | |
431 | 431 | $this->getManager()->manageImportFromDatabase($this, $data, $prefix); |
432 | 432 |
@@ -46,11 +46,11 @@ discard block |
||
46 | 46 | class RemoteInstance extends NCSignatory implements IQueryRow, JsonSerializable { |
47 | 47 | use TArrayTools; |
48 | 48 | |
49 | - public const TYPE_UNKNOWN = 'Unknown'; // not trusted |
|
50 | - public const TYPE_PASSIVE = 'Passive'; // Minimum information about Federated Circles are broadcasted if a member belongs to the circle. |
|
51 | - public const TYPE_EXTERNAL = 'External'; // info about Federated Circles and their members are broadcasted if a member belongs to the circle. |
|
52 | - public const TYPE_TRUSTED = 'Trusted'; // everything about Federated Circles are broadcasted. |
|
53 | - public const TYPE_GLOBALSCALE = 'GlobalScale'; // every Circle is broadcasted, |
|
49 | + public const TYPE_UNKNOWN = 'Unknown'; // not trusted |
|
50 | + public const TYPE_PASSIVE = 'Passive'; // Minimum information about Federated Circles are broadcasted if a member belongs to the circle. |
|
51 | + public const TYPE_EXTERNAL = 'External'; // info about Federated Circles and their members are broadcasted if a member belongs to the circle. |
|
52 | + public const TYPE_TRUSTED = 'Trusted'; // everything about Federated Circles are broadcasted. |
|
53 | + public const TYPE_GLOBALSCALE = 'GlobalScale'; // every Circle is broadcasted, |
|
54 | 54 | |
55 | 55 | public static $LIST_TYPE = [ |
56 | 56 | self::TYPE_UNKNOWN, |
@@ -526,7 +526,7 @@ discard block |
||
526 | 526 | ]; |
527 | 527 | |
528 | 528 | if ($this->getAuthSigned() !== '') { |
529 | - $data[self::AUTH_SIGNED] = $this->getAlgorithm() . ':' . $this->getAuthSigned(); |
|
529 | + $data[self::AUTH_SIGNED] = $this->getAlgorithm().':'.$this->getAuthSigned(); |
|
530 | 530 | } |
531 | 531 | |
532 | 532 | if (!empty($this->getAliases())) { |
@@ -545,17 +545,17 @@ discard block |
||
545 | 545 | * @throws RemoteNotFoundException |
546 | 546 | */ |
547 | 547 | public function importFromDatabase(array $data, string $prefix = ''): IQueryRow { |
548 | - if ($this->getInt($prefix . 'id', $data) === 0) { |
|
548 | + if ($this->getInt($prefix.'id', $data) === 0) { |
|
549 | 549 | throw new RemoteNotFoundException(); |
550 | 550 | } |
551 | 551 | |
552 | - $this->setDbId($this->getInt($prefix . 'id', $data)); |
|
553 | - $this->import($this->getArray($prefix . 'item', $data)); |
|
554 | - $this->setOrigData($this->getArray($prefix . 'item', $data)); |
|
555 | - $this->setType($this->get($prefix . 'type', $data)); |
|
556 | - $this->setInterface($this->getInt($prefix . 'interface', $data)); |
|
557 | - $this->setInstance($this->get($prefix . 'instance', $data)); |
|
558 | - $this->setId($this->get($prefix . 'href', $data)); |
|
552 | + $this->setDbId($this->getInt($prefix.'id', $data)); |
|
553 | + $this->import($this->getArray($prefix.'item', $data)); |
|
554 | + $this->setOrigData($this->getArray($prefix.'item', $data)); |
|
555 | + $this->setType($this->get($prefix.'type', $data)); |
|
556 | + $this->setInterface($this->getInt($prefix.'interface', $data)); |
|
557 | + $this->setInstance($this->get($prefix.'instance', $data)); |
|
558 | + $this->setId($this->get($prefix.'href', $data)); |
|
559 | 559 | |
560 | 560 | return $this; |
561 | 561 | } |
@@ -293,7 +293,7 @@ discard block |
||
293 | 293 | $item = new $class(); |
294 | 294 | if (!$item instanceof IDeserializable && !$item instanceof JsonSerializable) { |
295 | 295 | throw new InvalidItemException( |
296 | - $class . ' does not implement IDeserializable and JsonSerializable' |
|
296 | + $class.' does not implement IDeserializable and JsonSerializable' |
|
297 | 297 | ); |
298 | 298 | } |
299 | 299 | |
@@ -420,7 +420,7 @@ discard block |
||
420 | 420 | foreach ($keys as $key) { |
421 | 421 | if (!$this->haveKey($key)) { |
422 | 422 | if ($must) { |
423 | - throw new MalformedArrayException($key . ' missing in ' . json_encode($this->keys())); |
|
423 | + throw new MalformedArrayException($key.' missing in '.json_encode($this->keys())); |
|
424 | 424 | } |
425 | 425 | |
426 | 426 | return false; |
@@ -81,7 +81,7 @@ |
||
81 | 81 | */ |
82 | 82 | public function createSimpleSignatory(NCSignatory $signatory): void { |
83 | 83 | $app = $this->setup('app', '', self::$SIGNATORIES_APP); |
84 | - $signatory->setKeyId($signatory->getId() . '#main-key'); |
|
84 | + $signatory->setKeyId($signatory->getId().'#main-key'); |
|
85 | 85 | $signatory->setKeyOwner($signatory->getId()); |
86 | 86 | $this->generateKeys($signatory); |
87 | 87 |
@@ -104,7 +104,7 @@ |
||
104 | 104 | for ($i = 0; $i < $config['node-spacing']; $i++) { |
105 | 105 | $spacing = substr($empty, 0, -3); |
106 | 106 | if (substr($spacing, -1) === ' ') { |
107 | - $spacing = substr($spacing, 0, -1) . '│'; |
|
107 | + $spacing = substr($spacing, 0, -1).'│'; |
|
108 | 108 | } |
109 | 109 | $output->writeln($spacing); |
110 | 110 | } |
@@ -404,7 +404,7 @@ discard block |
||
404 | 404 | foreach ($keys as $key) { |
405 | 405 | if (!array_key_exists($key, $arr)) { |
406 | 406 | throw new MalformedArrayException( |
407 | - 'source: ' . json_encode($arr) . ' - missing key: ' . $key |
|
407 | + 'source: '.json_encode($arr).' - missing key: '.$key |
|
408 | 408 | ); |
409 | 409 | } |
410 | 410 | } |
@@ -417,7 +417,7 @@ discard block |
||
417 | 417 | protected function cleanArray(array &$arr) { |
418 | 418 | $arr = array_filter( |
419 | 419 | $arr, |
420 | - function ($v) { |
|
420 | + function($v) { |
|
421 | 421 | if (is_string($v)) { |
422 | 422 | return ($v !== ''); |
423 | 423 | } |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | $this->updateSignatory($signatory, $this->retrieveJson($request), $keyId); |
96 | 96 | } catch (RequestNetworkException $e) { |
97 | 97 | $this->debug('network issue while downloading Signatory', ['request' => $request]); |
98 | - throw new SignatoryException('network issue: ' . $e->getMessage()); |
|
98 | + throw new SignatoryException('network issue: '.$e->getMessage()); |
|
99 | 99 | } |
100 | 100 | } |
101 | 101 | |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | return $host; |
142 | 142 | } |
143 | 143 | |
144 | - throw new InvalidOriginException('cannot retrieve origin from ' . $keyId); |
|
144 | + throw new InvalidOriginException('cannot retrieve origin from '.$keyId); |
|
145 | 145 | } |
146 | 146 | |
147 | 147 |
@@ -63,7 +63,7 @@ |
||
63 | 63 | echo($result); |
64 | 64 | |
65 | 65 | $size = ob_get_length(); |
66 | - header('Content-Length: ' . $size); |
|
66 | + header('Content-Length: '.$size); |
|
67 | 67 | ob_end_flush(); |
68 | 68 | flush(); |
69 | 69 | } |