Completed
Push — master ( 9c8b50...ae0aa1 )
by
unknown
41:54 queued 12:01
created
apps/user_ldap/lib/Connection.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -222,7 +222,7 @@  discard block
 block discarded – undo
222 222
 	 * @param bool $state
223 223
 	 */
224 224
 	public function setIgnoreValidation($state) {
225
-		$this->ignoreValidation = (bool)$state;
225
+		$this->ignoreValidation = (bool) $state;
226 226
 	}
227 227
 
228 228
 	/**
@@ -243,7 +243,7 @@  discard block
 block discarded – undo
243 243
 		}
244 244
 		if (is_null($this->ldapConnectionRes)) {
245 245
 			$this->logger->error(
246
-				'No LDAP Connection to server ' . $this->configuration->ldapHost,
246
+				'No LDAP Connection to server '.$this->configuration->ldapHost,
247 247
 				['app' => 'user_ldap']
248 248
 			);
249 249
 			throw new ServerNotAvailableException('Connection to LDAP server could not be established');
@@ -266,11 +266,11 @@  discard block
 block discarded – undo
266 266
 	 * @param string|null $key
267 267
 	 */
268 268
 	private function getCacheKey($key): string {
269
-		$prefix = 'LDAP-' . $this->configID . '-' . $this->configPrefix . '-';
269
+		$prefix = 'LDAP-'.$this->configID.'-'.$this->configPrefix.'-';
270 270
 		if (is_null($key)) {
271 271
 			return $prefix;
272 272
 		}
273
-		return $prefix . hash('sha256', $key);
273
+		return $prefix.hash('sha256', $key);
274 274
 	}
275 275
 
276 276
 	/**
@@ -418,14 +418,14 @@  discard block
 block discarded – undo
418 418
 					$this->configuration->$effectiveSetting = 'auto';
419 419
 					$this->configuration->saveConfiguration();
420 420
 					$this->logger->info(
421
-						'Illegal value for the ' . $effectiveSetting . ', reset to autodetect.',
421
+						'Illegal value for the '.$effectiveSetting.', reset to autodetect.',
422 422
 						['app' => 'user_ldap']
423 423
 					);
424 424
 				}
425 425
 			}
426 426
 		}
427 427
 
428
-		$backupPort = (int)$this->configuration->ldapBackupPort;
428
+		$backupPort = (int) $this->configuration->ldapBackupPort;
429 429
 		if ($backupPort <= 0) {
430 430
 			$this->configuration->ldapBackupPort = $this->configuration->ldapPort;
431 431
 		}
@@ -440,9 +440,9 @@  discard block
 block discarded – undo
440 440
 			}
441 441
 		}
442 442
 
443
-		if ((stripos((string)$this->configuration->ldapHost, 'ldaps://') === 0)
443
+		if ((stripos((string) $this->configuration->ldapHost, 'ldaps://') === 0)
444 444
 			&& $this->configuration->ldapTLS) {
445
-			$this->configuration->ldapTLS = (string)false;
445
+			$this->configuration->ldapTLS = (string) false;
446 446
 			$this->logger->info(
447 447
 				'LDAPS (already using secure connection) and TLS do not work together. Switched off TLS.',
448 448
 				['app' => 'user_ldap']
@@ -487,7 +487,7 @@  discard block
 block discarded – undo
487 487
 						break;
488 488
 				}
489 489
 				throw new ConfigurationIssueException(
490
-					'No ' . $subj . ' given!',
490
+					'No '.$subj.' given!',
491 491
 					$this->l10n->t('Mandatory field "%s" left empty', $subj),
492 492
 				);
493 493
 			}
@@ -534,7 +534,7 @@  discard block
 block discarded – undo
534 534
 			);
535 535
 		}
536 536
 
537
-		if (mb_strpos((string)$this->configuration->ldapLoginFilter, '%uid', 0, 'UTF-8') === false) {
537
+		if (mb_strpos((string) $this->configuration->ldapLoginFilter, '%uid', 0, 'UTF-8') === false) {
538 538
 			throw new ConfigurationIssueException(
539 539
 				'Login filter does not contain %uid placeholder.',
540 540
 				$this->l10n->t('Login filter does not contain %s placeholder.', ['%uid']),
@@ -587,7 +587,7 @@  discard block
 block discarded – undo
587 587
 				throw $e;
588 588
 			}
589 589
 			$this->logger->warning(
590
-				'Configuration Error (prefix ' . $this->configPrefix . '): ' . $e->getMessage(),
590
+				'Configuration Error (prefix '.$this->configPrefix.'): '.$e->getMessage(),
591 591
 				['exception' => $e]
592 592
 			);
593 593
 			return false;
@@ -720,7 +720,7 @@  discard block
 block discarded – undo
720 720
 
721 721
 		if ($this->configuration->ldapTLS) {
722 722
 			if (!$this->ldap->startTls($this->ldapConnectionRes)) {
723
-				throw new ServerNotAvailableException('Start TLS failed, when connecting to LDAP host ' . $host . '.');
723
+				throw new ServerNotAvailableException('Start TLS failed, when connecting to LDAP host '.$host.'.');
724 724
 			}
725 725
 		}
726 726
 
@@ -741,7 +741,7 @@  discard block
 block discarded – undo
741 741
 
742 742
 		if (
743 743
 			count($this->bindResult) !== 0
744
-			&& $this->bindResult['sum'] === md5($this->configuration->ldapAgentName . $this->configPrefix . $this->configuration->ldapAgentPassword)
744
+			&& $this->bindResult['sum'] === md5($this->configuration->ldapAgentName.$this->configPrefix.$this->configuration->ldapAgentPassword)
745 745
 		) {
746 746
 			// don't attempt to bind again with the same data as before
747 747
 			// bind might have been invoked via getConnectionResource(),
@@ -754,7 +754,7 @@  discard block
 block discarded – undo
754 754
 			$this->configuration->ldapAgentPassword);
755 755
 
756 756
 		$this->bindResult = [
757
-			'sum' => md5($this->configuration->ldapAgentName . $this->configPrefix . $this->configuration->ldapAgentPassword),
757
+			'sum' => md5($this->configuration->ldapAgentName.$this->configPrefix.$this->configuration->ldapAgentPassword),
758 758
 			'result' => $ldapLogin,
759 759
 		];
760 760
 
@@ -762,7 +762,7 @@  discard block
 block discarded – undo
762 762
 			$errno = $this->ldap->errno($cr);
763 763
 
764 764
 			$this->logger->warning(
765
-				'Bind failed: ' . $errno . ': ' . $this->ldap->error($cr),
765
+				'Bind failed: '.$errno.': '.$this->ldap->error($cr),
766 766
 				['app' => 'user_ldap']
767 767
 			);
768 768
 
Please login to merge, or discard this patch.