@@ -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 | |
@@ -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 | |
@@ -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 | |
@@ -358,7 +358,7 @@ discard block |
||
| 358 | 358 | |
| 359 | 359 | |
| 360 | 360 | /** |
| 361 | - * @param ?Member $owner |
|
| 361 | + * @param Member $owner |
|
| 362 | 362 | * |
| 363 | 363 | * @return self |
| 364 | 364 | */ |
@@ -414,7 +414,7 @@ discard block |
||
| 414 | 414 | |
| 415 | 415 | |
| 416 | 416 | /** |
| 417 | - * @param array $members |
|
| 417 | + * @param Member[] $members |
|
| 418 | 418 | * @param bool $detailed |
| 419 | 419 | * |
| 420 | 420 | * @return self |
@@ -84,26 +84,26 @@ discard block |
||
| 84 | 84 | |
| 85 | 85 | |
| 86 | 86 | // specific value |
| 87 | - const CFG_CIRCLE = 0; // only for code readability. Circle is locked by default. |
|
| 88 | - const CFG_SINGLE = 1; // Circle with only one single member. |
|
| 89 | - const CFG_PERSONAL = 2; // Personal circle, only the owner can see it. |
|
| 87 | + const CFG_CIRCLE = 0; // only for code readability. Circle is locked by default. |
|
| 88 | + const CFG_SINGLE = 1; // Circle with only one single member. |
|
| 89 | + const CFG_PERSONAL = 2; // Personal circle, only the owner can see it. |
|
| 90 | 90 | |
| 91 | 91 | // bitwise |
| 92 | - const CFG_SYSTEM = 4; // System Circle (not managed by the official front-end). Meaning some config are limited |
|
| 93 | - const CFG_VISIBLE = 8; // Visible to everyone, if not visible, people have to know its name to be able to find it |
|
| 94 | - const CFG_OPEN = 16; // Circle is open, people can join |
|
| 95 | - const CFG_INVITE = 32; // Adding a member generate an invitation that needs to be accepted |
|
| 96 | - const CFG_REQUEST = 64; // Request to join Circles needs to be confirmed by a moderator |
|
| 97 | - const CFG_FRIEND = 128; // Members of the circle can invite their friends |
|
| 98 | - const CFG_PROTECTED = 256; // Password protected to join/request |
|
| 99 | - const CFG_NO_OWNER = 512; // no owner, only members |
|
| 100 | - const CFG_HIDDEN = 1024; // hidden from listing, but available as a share entity |
|
| 101 | - const CFG_BACKEND = 2048; // Fully hidden, only backend Circles |
|
| 102 | - const CFG_LOCAL = 4096; // Local even on GlobalScale |
|
| 103 | - const CFG_ROOT = 8192; // Circle cannot be inside another Circle |
|
| 104 | - const CFG_CIRCLE_INVITE = 16384; // Circle must confirm when invited in another circle |
|
| 105 | - const CFG_FEDERATED = 32768; // Federated |
|
| 106 | - const CFG_MOUNTPOINT = 65536; // Generate a Files folder for this Circle |
|
| 92 | + const CFG_SYSTEM = 4; // System Circle (not managed by the official front-end). Meaning some config are limited |
|
| 93 | + const CFG_VISIBLE = 8; // Visible to everyone, if not visible, people have to know its name to be able to find it |
|
| 94 | + const CFG_OPEN = 16; // Circle is open, people can join |
|
| 95 | + const CFG_INVITE = 32; // Adding a member generate an invitation that needs to be accepted |
|
| 96 | + const CFG_REQUEST = 64; // Request to join Circles needs to be confirmed by a moderator |
|
| 97 | + const CFG_FRIEND = 128; // Members of the circle can invite their friends |
|
| 98 | + const CFG_PROTECTED = 256; // Password protected to join/request |
|
| 99 | + const CFG_NO_OWNER = 512; // no owner, only members |
|
| 100 | + const CFG_HIDDEN = 1024; // hidden from listing, but available as a share entity |
|
| 101 | + const CFG_BACKEND = 2048; // Fully hidden, only backend Circles |
|
| 102 | + const CFG_LOCAL = 4096; // Local even on GlobalScale |
|
| 103 | + const CFG_ROOT = 8192; // Circle cannot be inside another Circle |
|
| 104 | + const CFG_CIRCLE_INVITE = 16384; // Circle must confirm when invited in another circle |
|
| 105 | + const CFG_FEDERATED = 32768; // Federated |
|
| 106 | + const CFG_MOUNTPOINT = 65536; // Generate a Files folder for this Circle |
|
| 107 | 107 | |
| 108 | 108 | public static $DEF_CFG_MAX = 131071; |
| 109 | 109 | |
@@ -702,22 +702,22 @@ discard block |
||
| 702 | 702 | * @throws CircleNotFoundException |
| 703 | 703 | */ |
| 704 | 704 | public function importFromDatabase(array $data, string $prefix = ''): INC22QueryRow { |
| 705 | - if ($this->get($prefix . 'unique_id', $data) === '') { |
|
| 705 | + if ($this->get($prefix.'unique_id', $data) === '') { |
|
| 706 | 706 | throw new CircleNotFoundException(); |
| 707 | 707 | } |
| 708 | 708 | |
| 709 | - $this->setSingleId($this->get($prefix . 'unique_id', $data)) |
|
| 710 | - ->setName($this->get($prefix . 'name', $data)) |
|
| 711 | - ->setDisplayName($this->get($prefix . 'display_name', $data)) |
|
| 712 | - ->setConfig($this->getInt($prefix . 'config', $data)) |
|
| 713 | - ->setSource($this->getInt($prefix . 'source', $data)) |
|
| 714 | - ->setInstance($this->get($prefix . 'instance', $data)) |
|
| 715 | - ->setSettings($this->getArray($prefix . 'settings', $data)) |
|
| 716 | - ->setContactAddressBook($this->getInt($prefix . 'contact_addressbook', $data)) |
|
| 717 | - ->setContactGroupName($this->get($prefix . 'contact_groupname', $data)) |
|
| 718 | - ->setDescription($this->get($prefix . 'description', $data)); |
|
| 719 | - |
|
| 720 | - $creation = $this->get($prefix . 'creation', $data); |
|
| 709 | + $this->setSingleId($this->get($prefix.'unique_id', $data)) |
|
| 710 | + ->setName($this->get($prefix.'name', $data)) |
|
| 711 | + ->setDisplayName($this->get($prefix.'display_name', $data)) |
|
| 712 | + ->setConfig($this->getInt($prefix.'config', $data)) |
|
| 713 | + ->setSource($this->getInt($prefix.'source', $data)) |
|
| 714 | + ->setInstance($this->get($prefix.'instance', $data)) |
|
| 715 | + ->setSettings($this->getArray($prefix.'settings', $data)) |
|
| 716 | + ->setContactAddressBook($this->getInt($prefix.'contact_addressbook', $data)) |
|
| 717 | + ->setContactGroupName($this->get($prefix.'contact_groupname', $data)) |
|
| 718 | + ->setDescription($this->get($prefix.'description', $data)); |
|
| 719 | + |
|
| 720 | + $creation = $this->get($prefix.'creation', $data); |
|
| 721 | 721 | $this->setCreation(DateTime::createFromFormat('Y-m-d H:i:s', $creation)->getTimestamp()); |
| 722 | 722 | |
| 723 | 723 | $this->getManager()->manageImportFromDatabase($this, $data, $prefix); |