Completed
Pull Request — master (#551)
by Maxence
03:24
created
lib/Model/Member.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -794,29 +794,29 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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;
Please login to merge, or discard this patch.
lib/Model/Helpers/MemberHelper.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 
Please login to merge, or discard this patch.
lib/Model/Membership.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -259,17 +259,17 @@
 block discarded – undo
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
 	}
Please login to merge, or discard this patch.