Completed
Push — master ( d94862...8c915b )
by Lukas
14:10
created
apps/user_ldap/ajax/getNewServerConfigPrefix.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -32,12 +32,12 @@
 block discarded – undo
32 32
 sort($serverConnections);
33 33
 $lk = array_pop($serverConnections);
34 34
 $ln = intval(str_replace('s', '', $lk));
35
-$nk = 's'.str_pad($ln+1, 2, '0', STR_PAD_LEFT);
35
+$nk = 's'.str_pad($ln + 1, 2, '0', STR_PAD_LEFT);
36 36
 
37 37
 $resultData = array('configPrefix' => $nk);
38 38
 
39 39
 $newConfig = new \OCA\User_LDAP\Configuration($nk, false);
40
-if(isset($_POST['copyConfig'])) {
40
+if (isset($_POST['copyConfig'])) {
41 41
 	$originalConfig = new \OCA\User_LDAP\Configuration($_POST['copyConfig']);
42 42
 	$newConfig->setConfiguration($originalConfig->getConfiguration());
43 43
 } else {
Please login to merge, or discard this patch.
apps/user_ldap/lib/Mapping/AbstractMapping.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
 	 * @return bool
54 54
 	 */
55 55
 	public function isColNameValid($col) {
56
-		switch($col) {
56
+		switch ($col) {
57 57
 			case 'ldap_dn':
58 58
 			case 'owncloud_name':
59 59
 			case 'directory_uuid':
@@ -72,19 +72,19 @@  discard block
 block discarded – undo
72 72
 	 * @return string|false
73 73
 	 */
74 74
 	protected function getXbyY($fetchCol, $compareCol, $search) {
75
-		if(!$this->isColNameValid($fetchCol)) {
75
+		if (!$this->isColNameValid($fetchCol)) {
76 76
 			//this is used internally only, but we don't want to risk
77 77
 			//having SQL injection at all.
78 78
 			throw new \Exception('Invalid Column Name');
79 79
 		}
80 80
 		$query = $this->dbc->prepare('
81
-			SELECT `' . $fetchCol . '`
82
-			FROM `'. $this->getTableName() .'`
83
-			WHERE `' . $compareCol . '` = ?
81
+			SELECT `' . $fetchCol.'`
82
+			FROM `'. $this->getTableName().'`
83
+			WHERE `' . $compareCol.'` = ?
84 84
 		');
85 85
 
86 86
 		$res = $query->execute(array($search));
87
-		if($res !== false) {
87
+		if ($res !== false) {
88 88
 			return $query->fetchColumn();
89 89
 		}
90 90
 
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
 	 */
121 121
 	public function setDNbyUUID($fdn, $uuid) {
122 122
 		$query = $this->dbc->prepare('
123
-			UPDATE `' . $this->getTableName() . '`
123
+			UPDATE `' . $this->getTableName().'`
124 124
 			SET `ldap_dn` = ?
125 125
 			WHERE `directory_uuid` = ?
126 126
 		');
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
 	 */
140 140
 	public function setUUIDbyDN($uuid, $fdn) {
141 141
 		$query = $this->dbc->prepare('
142
-			UPDATE `' . $this->getTableName() . '`
142
+			UPDATE `' . $this->getTableName().'`
143 143
 			SET `directory_uuid` = ?
144 144
 			WHERE `ldap_dn` = ?
145 145
 		');
@@ -166,14 +166,14 @@  discard block
 block discarded – undo
166 166
 	public function getNamesBySearch($search, $prefixMatch = "", $postfixMatch = "") {
167 167
 		$query = $this->dbc->prepare('
168 168
 			SELECT `owncloud_name`
169
-			FROM `'. $this->getTableName() .'`
169
+			FROM `'. $this->getTableName().'`
170 170
 			WHERE `owncloud_name` LIKE ?
171 171
 		');
172 172
 
173 173
 		$res = $query->execute(array($prefixMatch.$this->dbc->escapeLikeParameter($search).$postfixMatch));
174 174
 		$names = array();
175
-		if($res !== false) {
176
-			while($row = $query->fetch()) {
175
+		if ($res !== false) {
176
+			while ($row = $query->fetch()) {
177 177
 				$names[] = $row['owncloud_name'];
178 178
 			}
179 179
 		}
@@ -211,7 +211,7 @@  discard block
 block discarded – undo
211 211
 				`ldap_dn` AS `dn`,
212 212
 				`owncloud_name` AS `name`,
213 213
 				`directory_uuid` AS `uuid`
214
-			FROM `' . $this->getTableName() . '`',
214
+			FROM `' . $this->getTableName().'`',
215 215
 			$limit,
216 216
 			$offset
217 217
 		);
@@ -228,7 +228,7 @@  discard block
 block discarded – undo
228 228
 	 * @return bool
229 229
 	 */
230 230
 	public function map($fdn, $name, $uuid) {
231
-		if(mb_strlen($fdn) > 255) {
231
+		if (mb_strlen($fdn) > 255) {
232 232
 			\OC::$server->getLogger()->error(
233 233
 				'Cannot map, because the DN exceeds 255 characters: {dn}',
234 234
 				[
@@ -248,7 +248,7 @@  discard block
 block discarded – undo
248 248
 		try {
249 249
 			$result = $this->dbc->insertIfNotExist($this->getTableName(), $row);
250 250
 			// insertIfNotExist returns values as int
251
-			return (bool)$result;
251
+			return (bool) $result;
252 252
 		} catch (\Exception $e) {
253 253
 			return false;
254 254
 		}
@@ -261,7 +261,7 @@  discard block
 block discarded – undo
261 261
 	 */
262 262
 	public function unmap($name) {
263 263
 		$query = $this->dbc->prepare('
264
-			DELETE FROM `'. $this->getTableName() .'`
264
+			DELETE FROM `'. $this->getTableName().'`
265 265
 			WHERE `owncloud_name` = ?');
266 266
 
267 267
 		return $this->modify($query, array($name));
@@ -274,7 +274,7 @@  discard block
 block discarded – undo
274 274
 	public function clear() {
275 275
 		$sql = $this->dbc
276 276
 			->getDatabasePlatform()
277
-			->getTruncateTableSQL('`' . $this->getTableName() . '`');
277
+			->getTruncateTableSQL('`'.$this->getTableName().'`');
278 278
 		return $this->dbc->prepare($sql)->execute();
279 279
 	}
280 280
 }
Please login to merge, or discard this patch.
apps/user_ldap/lib/LDAP.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -52,12 +52,12 @@  discard block
 block discarded – undo
52 52
 	 * @return mixed
53 53
 	 */
54 54
 	public function connect($host, $port) {
55
-		if(strpos($host, '://') === false) {
56
-			$host = 'ldap://' . $host;
55
+		if (strpos($host, '://') === false) {
56
+			$host = 'ldap://'.$host;
57 57
 		}
58
-		if(strpos($host, ':', strpos($host, '://') + 1) === false) {
58
+		if (strpos($host, ':', strpos($host, '://') + 1) === false) {
59 59
 			//ldap_connect ignores port parameter when URLs are passed
60
-			$host .= ':' . $port;
60
+			$host .= ':'.$port;
61 61
 		}
62 62
 		return $this->invokeLDAPMethod('connect', $host);
63 63
 	}
@@ -267,13 +267,13 @@  discard block
 block discarded – undo
267 267
 	 * @return bool
268 268
 	 */
269 269
 	protected function isResultFalse($result) {
270
-		if($result === false) {
270
+		if ($result === false) {
271 271
 			return true;
272 272
 		}
273 273
 
274
-		if($this->curFunc === 'ldap_search' && is_array($result)) {
274
+		if ($this->curFunc === 'ldap_search' && is_array($result)) {
275 275
 			foreach ($result as $singleResult) {
276
-				if($singleResult === false) {
276
+				if ($singleResult === false) {
277 277
 					return true;
278 278
 				}
279 279
 			}
@@ -287,8 +287,8 @@  discard block
 block discarded – undo
287 287
 	 */
288 288
 	protected function invokeLDAPMethod() {
289 289
 		$arguments = func_get_args();
290
-		$func = 'ldap_' . array_shift($arguments);
291
-		if(function_exists($func)) {
290
+		$func = 'ldap_'.array_shift($arguments);
291
+		if (function_exists($func)) {
292 292
 			$this->preFunctionCall($func, $arguments);
293 293
 			$result = call_user_func_array($func, $arguments);
294 294
 			if ($this->isResultFalse($result)) {
@@ -318,12 +318,12 @@  discard block
 block discarded – undo
318 318
 	 */
319 319
 	private function processLDAPError($resource) {
320 320
 		$errorCode = ldap_errno($resource);
321
-		if($errorCode === 0) {
321
+		if ($errorCode === 0) {
322 322
 			return;
323 323
 		}
324
-		$errorMsg  = ldap_error($resource);
324
+		$errorMsg = ldap_error($resource);
325 325
 
326
-		if($this->curFunc === 'ldap_get_entries'
326
+		if ($this->curFunc === 'ldap_get_entries'
327 327
 			&& $errorCode === -4) {
328 328
 		} else if ($errorCode === 32) {
329 329
 			//for now
@@ -337,10 +337,10 @@  discard block
 block discarded – undo
337 337
 			throw new \Exception('LDAP Operations error', $errorCode);
338 338
 		} else if ($errorCode === 19) {
339 339
 			ldap_get_option($this->curArgs[0], LDAP_OPT_ERROR_STRING, $extended_error);
340
-			throw new ConstraintViolationException(!empty($extended_error)?$extended_error:$errorMsg, $errorCode);
340
+			throw new ConstraintViolationException(!empty($extended_error) ? $extended_error : $errorMsg, $errorCode);
341 341
 		} else {
342 342
 			\OCP\Util::writeLog('user_ldap',
343
-				'LDAP error '.$errorMsg.' (' .
343
+				'LDAP error '.$errorMsg.' ('.
344 344
 				$errorCode.') after calling '.
345 345
 				$this->curFunc,
346 346
 				\OCP\Util::DEBUG);
@@ -351,9 +351,9 @@  discard block
 block discarded – undo
351 351
 	 * Called after an ldap method is run to act on LDAP error if necessary
352 352
 	 */
353 353
 	private function postFunctionCall() {
354
-		if($this->isResource($this->curArgs[0])) {
354
+		if ($this->isResource($this->curArgs[0])) {
355 355
 			$resource = $this->curArgs[0];
356
-		} else if(
356
+		} else if (
357 357
 			   $this->curFunc === 'ldap_search'
358 358
 			&& is_array($this->curArgs[0])
359 359
 			&& $this->isResource($this->curArgs[0][0])
Please login to merge, or discard this patch.
apps/user_ldap/lib/User/DeletedUsersIndex.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
 			'user_ldap', 'isDeleted', '1');
72 72
 
73 73
 		$userObjects = array();
74
-		foreach($deletedUsers as $user) {
74
+		foreach ($deletedUsers as $user) {
75 75
 			$userObjects[] = new OfflineUser($user, $this->config, $this->db, $this->mapping);
76 76
 		}
77 77
 		$this->deletedUsers = $userObjects;
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
 	 * @return \OCA\User_LDAP\User\OfflineUser[]
85 85
 	 */
86 86
 	public function getUsers() {
87
-		if(is_array($this->deletedUsers)) {
87
+		if (is_array($this->deletedUsers)) {
88 88
 			return $this->deletedUsers;
89 89
 		}
90 90
 		return $this->fetchDeletedUsers();
@@ -95,10 +95,10 @@  discard block
 block discarded – undo
95 95
 	 * @return bool
96 96
 	 */
97 97
 	public function hasUsers() {
98
-		if($this->deletedUsers === false) {
98
+		if ($this->deletedUsers === false) {
99 99
 			$this->fetchDeletedUsers();
100 100
 		}
101
-		if(is_array($this->deletedUsers) && count($this->deletedUsers) > 0) {
101
+		if (is_array($this->deletedUsers) && count($this->deletedUsers) > 0) {
102 102
 			return true;
103 103
 		}
104 104
 		return false;
Please login to merge, or discard this patch.
apps/user_ldap/lib/User/OfflineUser.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -179,14 +179,14 @@  discard block
 block discarded – undo
179 179
 	 * reads the user details
180 180
 	 */
181 181
 	protected function fetchDetails() {
182
-		$properties = array (
182
+		$properties = array(
183 183
 			'displayName' => 'user_ldap',
184 184
 			'uid'         => 'user_ldap',
185 185
 			'homePath'    => 'user_ldap',
186 186
 			'email'       => 'settings',
187 187
 			'lastLogin'   => 'login'
188 188
 		);
189
-		foreach($properties as $property => $app) {
189
+		foreach ($properties as $property => $app) {
190 190
 			$this->$property = $this->config->getUserValue($this->ocName, $app, $property, '');
191 191
 		}
192 192
 
@@ -209,7 +209,7 @@  discard block
 block discarded – undo
209 209
 		', 1);
210 210
 		$query->execute(array($this->ocName));
211 211
 		$sResult = $query->fetchColumn(0);
212
-		if(intval($sResult) === 1) {
212
+		if (intval($sResult) === 1) {
213 213
 			$this->hasActiveShares = true;
214 214
 			return;
215 215
 		}
@@ -221,7 +221,7 @@  discard block
 block discarded – undo
221 221
 		', 1);
222 222
 		$query->execute(array($this->ocName));
223 223
 		$sResult = $query->fetchColumn(0);
224
-		if(intval($sResult) === 1) {
224
+		if (intval($sResult) === 1) {
225 225
 			$this->hasActiveShares = true;
226 226
 			return;
227 227
 		}
Please login to merge, or discard this patch.
apps/user_ldap/lib/Controller/ConfigAPIController.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -147,12 +147,12 @@  discard block
 block discarded – undo
147 147
 	public function delete($configID) {
148 148
 		try {
149 149
 			$this->ensureConfigIDExists($configID);
150
-			if(!$this->ldapHelper->deleteServerConfiguration($configID)) {
150
+			if (!$this->ldapHelper->deleteServerConfiguration($configID)) {
151 151
 				throw new OCSException('Could not delete configuration');
152 152
 			}
153
-		} catch(OCSException $e) {
153
+		} catch (OCSException $e) {
154 154
 			throw $e;
155
-		} catch(\Exception $e) {
155
+		} catch (\Exception $e) {
156 156
 			$this->logger->logException($e);
157 157
 			throw new OCSException('An issue occurred when deleting the config.');
158 158
 		}
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
 		try {
188 188
 			$this->ensureConfigIDExists($configID);
189 189
 
190
-			if(!is_array($configData)) {
190
+			if (!is_array($configData)) {
191 191
 				throw new OCSBadRequestException('configData is not properly set');
192 192
 			}
193 193
 
@@ -195,13 +195,13 @@  discard block
 block discarded – undo
195 195
 			$configKeys = $configuration->getConfigTranslationArray();
196 196
 
197 197
 			foreach ($configKeys as $i => $key) {
198
-				if(isset($configData[$key])) {
198
+				if (isset($configData[$key])) {
199 199
 					$configuration->$key = $configData[$key];
200 200
 				}
201 201
 			}
202 202
 
203 203
 			$configuration->saveConfiguration();
204
-		} catch(OCSException $e) {
204
+		} catch (OCSException $e) {
205 205
 			throw $e;
206 206
 		} catch (\Exception $e) {
207 207
 			$this->logger->logException($e);
@@ -288,16 +288,16 @@  discard block
 block discarded – undo
288 288
 
289 289
 			$config = new Configuration($configID);
290 290
 			$data = $config->getConfiguration();
291
-			if(!boolval(intval($showPassword))) {
291
+			if (!boolval(intval($showPassword))) {
292 292
 				$data['ldapAgentPassword'] = '***';
293 293
 			}
294 294
 			foreach ($data as $key => $value) {
295
-				if(is_array($value)) {
295
+				if (is_array($value)) {
296 296
 					$value = implode(';', $value);
297 297
 					$data[$key] = $value;
298 298
 				}
299 299
 			}
300
-		} catch(OCSException $e) {
300
+		} catch (OCSException $e) {
301 301
 			throw $e;
302 302
 		} catch (\Exception $e) {
303 303
 			$this->logger->logException($e);
@@ -315,7 +315,7 @@  discard block
 block discarded – undo
315 315
 	 */
316 316
 	private function ensureConfigIDExists($configID) {
317 317
 		$prefixes = $this->ldapHelper->getServerConfigurationPrefixes();
318
-		if(!in_array($configID, $prefixes, true)) {
318
+		if (!in_array($configID, $prefixes, true)) {
319 319
 			throw new OCSNotFoundException('Config ID not found');
320 320
 		}
321 321
 	}
Please login to merge, or discard this patch.
apps/user_ldap/lib/Jobs/UpdateGroups.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -45,14 +45,14 @@  discard block
 block discarded – undo
45 45
 
46 46
 	static private $groupBE;
47 47
 
48
-	public function __construct(){
48
+	public function __construct() {
49 49
 		$this->interval = self::getRefreshInterval();
50 50
 	}
51 51
 
52 52
 	/**
53 53
 	 * @param mixed $argument
54 54
 	 */
55
-	public function run($argument){
55
+	public function run($argument) {
56 56
 		self::updateGroups();
57 57
 	}
58 58
 
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
 		$knownGroups = array_keys(self::getKnownGroups());
63 63
 		$actualGroups = self::getGroupBE()->getGroups();
64 64
 
65
-		if(empty($actualGroups) && empty($knownGroups)) {
65
+		if (empty($actualGroups) && empty($knownGroups)) {
66 66
 			\OCP\Util::writeLog('user_ldap',
67 67
 				'bgJ "updateGroups" – groups do not seem to be configured properly, aborting.',
68 68
 				\OCP\Util::INFO);
@@ -94,26 +94,26 @@  discard block
 block discarded – undo
94 94
 			SET `owncloudusers` = ?
95 95
 			WHERE `owncloudname` = ?
96 96
 		');
97
-		foreach($groups as $group) {
97
+		foreach ($groups as $group) {
98 98
 			//we assume, that self::$groupsFromDB has been retrieved already
99 99
 			$knownUsers = unserialize(self::$groupsFromDB[$group]['owncloudusers']);
100 100
 			$actualUsers = self::getGroupBE()->usersInGroup($group);
101 101
 			$hasChanged = false;
102
-			foreach(array_diff($knownUsers, $actualUsers) as $removedUser) {
102
+			foreach (array_diff($knownUsers, $actualUsers) as $removedUser) {
103 103
 				\OCP\Util::emitHook('OC_User', 'post_removeFromGroup', array('uid' => $removedUser, 'gid' => $group));
104 104
 				\OCP\Util::writeLog('user_ldap',
105 105
 				'bgJ "updateGroups" – "'.$removedUser.'" removed from "'.$group.'".',
106 106
 				\OCP\Util::INFO);
107 107
 				$hasChanged = true;
108 108
 			}
109
-			foreach(array_diff($actualUsers, $knownUsers) as $addedUser) {
109
+			foreach (array_diff($actualUsers, $knownUsers) as $addedUser) {
110 110
 				\OCP\Util::emitHook('OC_User', 'post_addToGroup', array('uid' => $addedUser, 'gid' => $group));
111 111
 				\OCP\Util::writeLog('user_ldap',
112 112
 				'bgJ "updateGroups" – "'.$addedUser.'" added to "'.$group.'".',
113 113
 				\OCP\Util::INFO);
114 114
 				$hasChanged = true;
115 115
 			}
116
-			if($hasChanged) {
116
+			if ($hasChanged) {
117 117
 				$query->execute(array(serialize($actualUsers), $group));
118 118
 			}
119 119
 		}
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
 			INTO `*PREFIX*ldap_group_members` (`owncloudname`, `owncloudusers`)
133 133
 			VALUES (?, ?)
134 134
 		');
135
-		foreach($createdGroups as $createdGroup) {
135
+		foreach ($createdGroups as $createdGroup) {
136 136
 			\OCP\Util::writeLog('user_ldap',
137 137
 				'bgJ "updateGroups" – new group "'.$createdGroup.'" found.',
138 138
 				\OCP\Util::INFO);
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
 			FROM `*PREFIX*ldap_group_members`
155 155
 			WHERE `owncloudname` = ?
156 156
 		');
157
-		foreach($removedGroups as $removedGroup) {
157
+		foreach ($removedGroups as $removedGroup) {
158 158
 			\OCP\Util::writeLog('user_ldap',
159 159
 				'bgJ "updateGroups" – group "'.$removedGroup.'" was removed.',
160 160
 				\OCP\Util::INFO);
@@ -169,13 +169,13 @@  discard block
 block discarded – undo
169 169
 	 * @return \OCA\User_LDAP\Group_LDAP|\OCA\User_LDAP\Group_Proxy
170 170
 	 */
171 171
 	static private function getGroupBE() {
172
-		if(!is_null(self::$groupBE)) {
172
+		if (!is_null(self::$groupBE)) {
173 173
 			return self::$groupBE;
174 174
 		}
175 175
 		$helper = new Helper(\OC::$server->getConfig());
176 176
 		$configPrefixes = $helper->getServerConfigurationPrefixes(true);
177 177
 		$ldapWrapper = new LDAP();
178
-		if(count($configPrefixes) === 1) {
178
+		if (count($configPrefixes) === 1) {
179 179
 			//avoid the proxy when there is only one LDAP server configured
180 180
 			$dbc = \OC::$server->getDatabaseConnection();
181 181
 			$userManager = new Manager(
@@ -204,7 +204,7 @@  discard block
 block discarded – undo
204 204
 	 * @return array
205 205
 	 */
206 206
 	static private function getKnownGroups() {
207
-		if(is_array(self::$groupsFromDB)) {
207
+		if (is_array(self::$groupsFromDB)) {
208 208
 			return self::$groupsFromDB;
209 209
 		}
210 210
 		$query = \OCP\DB::prepare('
@@ -213,7 +213,7 @@  discard block
 block discarded – undo
213 213
 		');
214 214
 		$result = $query->execute()->fetchAll();
215 215
 		self::$groupsFromDB = array();
216
-		foreach($result as $dataset) {
216
+		foreach ($result as $dataset) {
217 217
 			self::$groupsFromDB[$dataset['owncloudname']] = $dataset;
218 218
 		}
219 219
 
Please login to merge, or discard this patch.
apps/user_ldap/lib/WizardResult.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
 	 * @param array|string $values
53 53
 	 */
54 54
 	public function addOptions($key, $values) {
55
-		if(!is_array($values)) {
55
+		if (!is_array($values)) {
56 56
 			$values = array($values);
57 57
 		}
58 58
 		$this->options[$key] = $values;
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
 	public function getResultArray() {
72 72
 		$result = array();
73 73
 		$result['changes'] = $this->changes;
74
-		if(count($this->options) > 0) {
74
+		if (count($this->options) > 0) {
75 75
 			$result['options'] = $this->options;
76 76
 		}
77 77
 		return $result;
Please login to merge, or discard this patch.
apps/user_ldap/lib/Migration/UUIDFixInsert.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
 	 */
72 72
 	public function run(IOutput $output) {
73 73
 		$installedVersion = $this->config->getAppValue('user_ldap', 'installed_version', '1.2.1');
74
-		if(version_compare($installedVersion, '1.2.1') !== -1) {
74
+		if (version_compare($installedVersion, '1.2.1') !== -1) {
75 75
 			return;
76 76
 		}
77 77
 
@@ -82,14 +82,14 @@  discard block
 block discarded – undo
82 82
 			do {
83 83
 				$retry = false;
84 84
 				$records = $mapper->getList($offset, $batchSize);
85
-				if(count($records) === 0){
85
+				if (count($records) === 0) {
86 86
 					continue;
87 87
 				}
88 88
 				try {
89 89
 					$this->jobList->add($jobClass, ['records' => $records]);
90 90
 					$offset += $batchSize;
91 91
 				} catch (\InvalidArgumentException $e) {
92
-					if(strpos($e->getMessage(), 'Background job arguments can\'t exceed 4000') !== false) {
92
+					if (strpos($e->getMessage(), 'Background job arguments can\'t exceed 4000') !== false) {
93 93
 						$batchSize = intval(floor(count($records) * 0.8));
94 94
 						$retry = true;
95 95
 					}
Please login to merge, or discard this patch.