Passed
Push — master ( b37a49...348454 )
by Joas
15:41 queued 15s
created
lib/private/DB/MissingIndexInformation.php 1 patch
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -28,16 +28,16 @@
 block discarded – undo
28 28
 namespace OC\DB;
29 29
 
30 30
 class MissingIndexInformation {
31
-	private $listOfMissingIndexes = [];
31
+    private $listOfMissingIndexes = [];
32 32
 
33
-	public function addHintForMissingSubject(string $tableName, string $indexName) {
34
-		$this->listOfMissingIndexes[] = [
35
-			'tableName' => $tableName,
36
-			'indexName' => $indexName
37
-		];
38
-	}
33
+    public function addHintForMissingSubject(string $tableName, string $indexName) {
34
+        $this->listOfMissingIndexes[] = [
35
+            'tableName' => $tableName,
36
+            'indexName' => $indexName
37
+        ];
38
+    }
39 39
 
40
-	public function getListOfMissingIndexes(): array {
41
-		return $this->listOfMissingIndexes;
42
-	}
40
+    public function getListOfMissingIndexes(): array {
41
+        return $this->listOfMissingIndexes;
42
+    }
43 43
 }
Please login to merge, or discard this patch.
lib/private/DB/MissingColumnInformation.php 1 patch
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -27,16 +27,16 @@
 block discarded – undo
27 27
 namespace OC\DB;
28 28
 
29 29
 class MissingColumnInformation {
30
-	private $listOfMissingColumns = [];
30
+    private $listOfMissingColumns = [];
31 31
 
32
-	public function addHintForMissingColumn(string $tableName, string $columnName): void {
33
-		$this->listOfMissingColumns[] = [
34
-			'tableName' => $tableName,
35
-			'columnName' => $columnName,
36
-		];
37
-	}
32
+    public function addHintForMissingColumn(string $tableName, string $columnName): void {
33
+        $this->listOfMissingColumns[] = [
34
+            'tableName' => $tableName,
35
+            'columnName' => $columnName,
36
+        ];
37
+    }
38 38
 
39
-	public function getListOfMissingColumns(): array {
40
-		return $this->listOfMissingColumns;
41
-	}
39
+    public function getListOfMissingColumns(): array {
40
+        return $this->listOfMissingColumns;
41
+    }
42 42
 }
Please login to merge, or discard this patch.
lib/private/AppFramework/Middleware/Security/CSPMiddleware.php 1 patch
Indentation   +35 added lines, -35 removed lines patch added patch discarded remove patch
@@ -37,46 +37,46 @@
 block discarded – undo
37 37
 
38 38
 class CSPMiddleware extends Middleware {
39 39
 
40
-	/** @var ContentSecurityPolicyManager */
41
-	private $contentSecurityPolicyManager;
42
-	/** @var ContentSecurityPolicyNonceManager */
43
-	private $cspNonceManager;
44
-	/** @var CsrfTokenManager */
45
-	private $csrfTokenManager;
40
+    /** @var ContentSecurityPolicyManager */
41
+    private $contentSecurityPolicyManager;
42
+    /** @var ContentSecurityPolicyNonceManager */
43
+    private $cspNonceManager;
44
+    /** @var CsrfTokenManager */
45
+    private $csrfTokenManager;
46 46
 
47
-	public function __construct(ContentSecurityPolicyManager $policyManager,
48
-								ContentSecurityPolicyNonceManager $cspNonceManager,
49
-								CsrfTokenManager $csrfTokenManager) {
50
-		$this->contentSecurityPolicyManager = $policyManager;
51
-		$this->cspNonceManager = $cspNonceManager;
52
-		$this->csrfTokenManager = $csrfTokenManager;
53
-	}
47
+    public function __construct(ContentSecurityPolicyManager $policyManager,
48
+                                ContentSecurityPolicyNonceManager $cspNonceManager,
49
+                                CsrfTokenManager $csrfTokenManager) {
50
+        $this->contentSecurityPolicyManager = $policyManager;
51
+        $this->cspNonceManager = $cspNonceManager;
52
+        $this->csrfTokenManager = $csrfTokenManager;
53
+    }
54 54
 
55
-	/**
56
-	 * Performs the default CSP modifications that may be injected by other
57
-	 * applications
58
-	 *
59
-	 * @param Controller $controller
60
-	 * @param string $methodName
61
-	 * @param Response $response
62
-	 * @return Response
63
-	 */
64
-	public function afterController($controller, $methodName, Response $response): Response {
65
-		$policy = !is_null($response->getContentSecurityPolicy()) ? $response->getContentSecurityPolicy() : new ContentSecurityPolicy();
55
+    /**
56
+     * Performs the default CSP modifications that may be injected by other
57
+     * applications
58
+     *
59
+     * @param Controller $controller
60
+     * @param string $methodName
61
+     * @param Response $response
62
+     * @return Response
63
+     */
64
+    public function afterController($controller, $methodName, Response $response): Response {
65
+        $policy = !is_null($response->getContentSecurityPolicy()) ? $response->getContentSecurityPolicy() : new ContentSecurityPolicy();
66 66
 
67
-		if (get_class($policy) === EmptyContentSecurityPolicy::class) {
68
-			return $response;
69
-		}
67
+        if (get_class($policy) === EmptyContentSecurityPolicy::class) {
68
+            return $response;
69
+        }
70 70
 
71
-		$defaultPolicy = $this->contentSecurityPolicyManager->getDefaultPolicy();
72
-		$defaultPolicy = $this->contentSecurityPolicyManager->mergePolicies($defaultPolicy, $policy);
71
+        $defaultPolicy = $this->contentSecurityPolicyManager->getDefaultPolicy();
72
+        $defaultPolicy = $this->contentSecurityPolicyManager->mergePolicies($defaultPolicy, $policy);
73 73
 
74
-		if ($this->cspNonceManager->browserSupportsCspV3()) {
75
-			$defaultPolicy->useJsNonce($this->csrfTokenManager->getToken()->getEncryptedValue());
76
-		}
74
+        if ($this->cspNonceManager->browserSupportsCspV3()) {
75
+            $defaultPolicy->useJsNonce($this->csrfTokenManager->getToken()->getEncryptedValue());
76
+        }
77 77
 
78
-		$response->setContentSecurityPolicy($defaultPolicy);
78
+        $response->setContentSecurityPolicy($defaultPolicy);
79 79
 
80
-		return $response;
81
-	}
80
+        return $response;
81
+    }
82 82
 }
Please login to merge, or discard this patch.
apps/user_ldap/lib/Notification/Notifier.php 1 patch
Indentation   +61 added lines, -61 removed lines patch added patch discarded remove patch
@@ -31,72 +31,72 @@
 block discarded – undo
31 31
 
32 32
 class Notifier implements INotifier {
33 33
 
34
-	/** @var IFactory */
35
-	protected $l10nFactory;
34
+    /** @var IFactory */
35
+    protected $l10nFactory;
36 36
 
37
-	/**
38
-	 * @param IFactory $l10nFactory
39
-	 */
40
-	public function __construct(\OCP\L10N\IFactory $l10nFactory) {
41
-		$this->l10nFactory = $l10nFactory;
42
-	}
37
+    /**
38
+     * @param IFactory $l10nFactory
39
+     */
40
+    public function __construct(\OCP\L10N\IFactory $l10nFactory) {
41
+        $this->l10nFactory = $l10nFactory;
42
+    }
43 43
 
44
-	/**
45
-	 * Identifier of the notifier, only use [a-z0-9_]
46
-	 *
47
-	 * @return string
48
-	 * @since 17.0.0
49
-	 */
50
-	public function getID(): string {
51
-		return 'user_ldap';
52
-	}
44
+    /**
45
+     * Identifier of the notifier, only use [a-z0-9_]
46
+     *
47
+     * @return string
48
+     * @since 17.0.0
49
+     */
50
+    public function getID(): string {
51
+        return 'user_ldap';
52
+    }
53 53
 
54
-	/**
55
-	 * Human readable name describing the notifier
56
-	 *
57
-	 * @return string
58
-	 * @since 17.0.0
59
-	 */
60
-	public function getName(): string {
61
-		return $this->l10nFactory->get('user_ldap')->t('LDAP User backend');
62
-	}
54
+    /**
55
+     * Human readable name describing the notifier
56
+     *
57
+     * @return string
58
+     * @since 17.0.0
59
+     */
60
+    public function getName(): string {
61
+        return $this->l10nFactory->get('user_ldap')->t('LDAP User backend');
62
+    }
63 63
 
64
-	/**
65
-	 * @param INotification $notification
66
-	 * @param string $languageCode The code of the language that should be used to prepare the notification
67
-	 * @return INotification
68
-	 * @throws \InvalidArgumentException When the notification was not prepared by a notifier
69
-	 */
70
-	public function prepare(INotification $notification, string $languageCode): INotification {
71
-		if ($notification->getApp() !== 'user_ldap') {
72
-			// Not my app => throw
73
-			throw new \InvalidArgumentException();
74
-		}
64
+    /**
65
+     * @param INotification $notification
66
+     * @param string $languageCode The code of the language that should be used to prepare the notification
67
+     * @return INotification
68
+     * @throws \InvalidArgumentException When the notification was not prepared by a notifier
69
+     */
70
+    public function prepare(INotification $notification, string $languageCode): INotification {
71
+        if ($notification->getApp() !== 'user_ldap') {
72
+            // Not my app => throw
73
+            throw new \InvalidArgumentException();
74
+        }
75 75
 
76
-		// Read the language from the notification
77
-		$l = $this->l10nFactory->get('user_ldap', $languageCode);
76
+        // Read the language from the notification
77
+        $l = $this->l10nFactory->get('user_ldap', $languageCode);
78 78
 
79
-		switch ($notification->getSubject()) {
80
-			// Deal with known subjects
81
-			case 'pwd_exp_warn_days':
82
-				$params = $notification->getSubjectParameters();
83
-				$days = (int) $params[0];
84
-				if ($days === 2) {
85
-					$notification->setParsedSubject($l->t('Your password will expire tomorrow.'));
86
-				} elseif ($days === 1) {
87
-					$notification->setParsedSubject($l->t('Your password will expire today.'));
88
-				} else {
89
-					$notification->setParsedSubject($l->n(
90
-						'Your password will expire within %n day.',
91
-						'Your password will expire within %n days.',
92
-						$days
93
-					));
94
-				}
95
-				return $notification;
79
+        switch ($notification->getSubject()) {
80
+            // Deal with known subjects
81
+            case 'pwd_exp_warn_days':
82
+                $params = $notification->getSubjectParameters();
83
+                $days = (int) $params[0];
84
+                if ($days === 2) {
85
+                    $notification->setParsedSubject($l->t('Your password will expire tomorrow.'));
86
+                } elseif ($days === 1) {
87
+                    $notification->setParsedSubject($l->t('Your password will expire today.'));
88
+                } else {
89
+                    $notification->setParsedSubject($l->n(
90
+                        'Your password will expire within %n day.',
91
+                        'Your password will expire within %n days.',
92
+                        $days
93
+                    ));
94
+                }
95
+                return $notification;
96 96
 
97
-			default:
98
-				// Unknown subject => Unknown notification => throw
99
-				throw new \InvalidArgumentException();
100
-		}
101
-	}
97
+            default:
98
+                // Unknown subject => Unknown notification => throw
99
+                throw new \InvalidArgumentException();
100
+        }
101
+    }
102 102
 }
Please login to merge, or discard this patch.
apps/user_ldap/lib/Handler/ExtStorageConfigHandler.php 1 patch
Indentation   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -30,40 +30,40 @@
 block discarded – undo
30 30
 use OCA\User_LDAP\User_Proxy;
31 31
 
32 32
 class ExtStorageConfigHandler extends UserContext implements IConfigHandler {
33
-	use SimpleSubstitutionTrait;
33
+    use SimpleSubstitutionTrait;
34 34
 
35
-	/**
36
-	 * @param mixed $optionValue
37
-	 * @return mixed the same type as $optionValue
38
-	 * @since 16.0.0
39
-	 * @throws \Exception
40
-	 */
41
-	public function handle($optionValue) {
42
-		$this->placeholder = 'home';
43
-		$user = $this->getUser();
35
+    /**
36
+     * @param mixed $optionValue
37
+     * @return mixed the same type as $optionValue
38
+     * @since 16.0.0
39
+     * @throws \Exception
40
+     */
41
+    public function handle($optionValue) {
42
+        $this->placeholder = 'home';
43
+        $user = $this->getUser();
44 44
 
45
-		if ($user === null) {
46
-			return $optionValue;
47
-		}
45
+        if ($user === null) {
46
+            return $optionValue;
47
+        }
48 48
 
49
-		$backend = $user->getBackend();
50
-		if (!$backend instanceof User_Proxy) {
51
-			return $optionValue;
52
-		}
49
+        $backend = $user->getBackend();
50
+        if (!$backend instanceof User_Proxy) {
51
+            return $optionValue;
52
+        }
53 53
 
54
-		$access = $backend->getLDAPAccess($user->getUID());
55
-		if (!$access) {
56
-			return $optionValue;
57
-		}
54
+        $access = $backend->getLDAPAccess($user->getUID());
55
+        if (!$access) {
56
+            return $optionValue;
57
+        }
58 58
 
59
-		$attribute = $access->connection->ldapExtStorageHomeAttribute;
60
-		if (empty($attribute)) {
61
-			return $optionValue;
62
-		}
59
+        $attribute = $access->connection->ldapExtStorageHomeAttribute;
60
+        if (empty($attribute)) {
61
+            return $optionValue;
62
+        }
63 63
 
64
-		$ldapUser = $access->userManager->get($user->getUID());
65
-		$extHome = $ldapUser->getExtStorageHome();
64
+        $ldapUser = $access->userManager->get($user->getUID());
65
+        $extHome = $ldapUser->getExtStorageHome();
66 66
 
67
-		return $this->processInput($optionValue, $extHome);
68
-	}
67
+        return $this->processInput($optionValue, $extHome);
68
+    }
69 69
 }
Please login to merge, or discard this patch.
apps/user_ldap/lib/WizardResult.php 1 patch
Indentation   +40 added lines, -40 removed lines patch added patch discarded remove patch
@@ -30,50 +30,50 @@
 block discarded – undo
30 30
 namespace OCA\User_LDAP;
31 31
 
32 32
 class WizardResult {
33
-	protected $changes = [];
34
-	protected $options = [];
35
-	protected $markedChange = false;
33
+    protected $changes = [];
34
+    protected $options = [];
35
+    protected $markedChange = false;
36 36
 
37
-	/**
38
-	 * @param string $key
39
-	 * @param mixed $value
40
-	 */
41
-	public function addChange($key, $value) {
42
-		$this->changes[$key] = $value;
43
-	}
37
+    /**
38
+     * @param string $key
39
+     * @param mixed $value
40
+     */
41
+    public function addChange($key, $value) {
42
+        $this->changes[$key] = $value;
43
+    }
44 44
 
45 45
 	
46
-	public function markChange() {
47
-		$this->markedChange = true;
48
-	}
46
+    public function markChange() {
47
+        $this->markedChange = true;
48
+    }
49 49
 
50
-	/**
51
-	 * @param string $key
52
-	 * @param array|string $values
53
-	 */
54
-	public function addOptions($key, $values) {
55
-		if (!is_array($values)) {
56
-			$values = [$values];
57
-		}
58
-		$this->options[$key] = $values;
59
-	}
50
+    /**
51
+     * @param string $key
52
+     * @param array|string $values
53
+     */
54
+    public function addOptions($key, $values) {
55
+        if (!is_array($values)) {
56
+            $values = [$values];
57
+        }
58
+        $this->options[$key] = $values;
59
+    }
60 60
 
61
-	/**
62
-	 * @return bool
63
-	 */
64
-	public function hasChanges() {
65
-		return (count($this->changes) > 0 || $this->markedChange);
66
-	}
61
+    /**
62
+     * @return bool
63
+     */
64
+    public function hasChanges() {
65
+        return (count($this->changes) > 0 || $this->markedChange);
66
+    }
67 67
 
68
-	/**
69
-	 * @return array
70
-	 */
71
-	public function getResultArray() {
72
-		$result = [];
73
-		$result['changes'] = $this->changes;
74
-		if (count($this->options) > 0) {
75
-			$result['options'] = $this->options;
76
-		}
77
-		return $result;
78
-	}
68
+    /**
69
+     * @return array
70
+     */
71
+    public function getResultArray() {
72
+        $result = [];
73
+        $result['changes'] = $this->changes;
74
+        if (count($this->options) > 0) {
75
+            $result['options'] = $this->options;
76
+        }
77
+        return $result;
78
+    }
79 79
 }
Please login to merge, or discard this patch.
apps/user_ldap/lib/Migration/UUIDFixInsert.php 1 patch
Indentation   +58 added lines, -58 removed lines patch added patch discarded remove patch
@@ -33,69 +33,69 @@
 block discarded – undo
33 33
 
34 34
 class UUIDFixInsert implements IRepairStep {
35 35
 
36
-	/** @var IConfig */
37
-	protected $config;
36
+    /** @var IConfig */
37
+    protected $config;
38 38
 
39
-	/** @var UserMapping */
40
-	protected $userMapper;
39
+    /** @var UserMapping */
40
+    protected $userMapper;
41 41
 
42
-	/** @var GroupMapping */
43
-	protected $groupMapper;
42
+    /** @var GroupMapping */
43
+    protected $groupMapper;
44 44
 
45
-	/** @var IJobList */
46
-	protected $jobList;
45
+    /** @var IJobList */
46
+    protected $jobList;
47 47
 
48
-	public function __construct(IConfig $config, UserMapping $userMapper, GroupMapping $groupMapper, IJobList $jobList) {
49
-		$this->config = $config;
50
-		$this->userMapper = $userMapper;
51
-		$this->groupMapper = $groupMapper;
52
-		$this->jobList = $jobList;
53
-	}
48
+    public function __construct(IConfig $config, UserMapping $userMapper, GroupMapping $groupMapper, IJobList $jobList) {
49
+        $this->config = $config;
50
+        $this->userMapper = $userMapper;
51
+        $this->groupMapper = $groupMapper;
52
+        $this->jobList = $jobList;
53
+    }
54 54
 
55
-	/**
56
-	 * Returns the step's name
57
-	 *
58
-	 * @return string
59
-	 * @since 9.1.0
60
-	 */
61
-	public function getName() {
62
-		return 'Insert UUIDFix background job for user and group in batches';
63
-	}
55
+    /**
56
+     * Returns the step's name
57
+     *
58
+     * @return string
59
+     * @since 9.1.0
60
+     */
61
+    public function getName() {
62
+        return 'Insert UUIDFix background job for user and group in batches';
63
+    }
64 64
 
65
-	/**
66
-	 * Run repair step.
67
-	 * Must throw exception on error.
68
-	 *
69
-	 * @param IOutput $output
70
-	 * @throws \Exception in case of failure
71
-	 * @since 9.1.0
72
-	 */
73
-	public function run(IOutput $output) {
74
-		$installedVersion = $this->config->getAppValue('user_ldap', 'installed_version', '1.2.1');
75
-		if (version_compare($installedVersion, '1.2.1') !== -1) {
76
-			return;
77
-		}
65
+    /**
66
+     * Run repair step.
67
+     * Must throw exception on error.
68
+     *
69
+     * @param IOutput $output
70
+     * @throws \Exception in case of failure
71
+     * @since 9.1.0
72
+     */
73
+    public function run(IOutput $output) {
74
+        $installedVersion = $this->config->getAppValue('user_ldap', 'installed_version', '1.2.1');
75
+        if (version_compare($installedVersion, '1.2.1') !== -1) {
76
+            return;
77
+        }
78 78
 
79
-		foreach ([$this->userMapper, $this->groupMapper] as $mapper) {
80
-			$offset = 0;
81
-			$batchSize = 50;
82
-			$jobClass = $mapper instanceof UserMapping ? UUIDFixUser::class : UUIDFixGroup::class;
83
-			do {
84
-				$retry = false;
85
-				$records = $mapper->getList($offset, $batchSize);
86
-				if (count($records) === 0) {
87
-					continue;
88
-				}
89
-				try {
90
-					$this->jobList->add($jobClass, ['records' => $records]);
91
-					$offset += $batchSize;
92
-				} catch (\InvalidArgumentException $e) {
93
-					if (strpos($e->getMessage(), 'Background job arguments can\'t exceed 4000') !== false) {
94
-						$batchSize = (int)floor(count($records) * 0.8);
95
-						$retry = true;
96
-					}
97
-				}
98
-			} while (count($records) === $batchSize || $retry);
99
-		}
100
-	}
79
+        foreach ([$this->userMapper, $this->groupMapper] as $mapper) {
80
+            $offset = 0;
81
+            $batchSize = 50;
82
+            $jobClass = $mapper instanceof UserMapping ? UUIDFixUser::class : UUIDFixGroup::class;
83
+            do {
84
+                $retry = false;
85
+                $records = $mapper->getList($offset, $batchSize);
86
+                if (count($records) === 0) {
87
+                    continue;
88
+                }
89
+                try {
90
+                    $this->jobList->add($jobClass, ['records' => $records]);
91
+                    $offset += $batchSize;
92
+                } catch (\InvalidArgumentException $e) {
93
+                    if (strpos($e->getMessage(), 'Background job arguments can\'t exceed 4000') !== false) {
94
+                        $batchSize = (int)floor(count($records) * 0.8);
95
+                        $retry = true;
96
+                    }
97
+                }
98
+            } while (count($records) === $batchSize || $retry);
99
+        }
100
+    }
101 101
 }
Please login to merge, or discard this patch.
apps/user_ldap/templates/part.wizard-server.php 1 patch
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -2,15 +2,15 @@
 block discarded – undo
2 2
 		<p>
3 3
 		<select id="ldap_serverconfig_chooser" name="ldap_serverconfig_chooser">
4 4
 		<?php
5
-		$i = 1;
6
-		$sel = ' selected';
7
-		foreach ($_['serverConfigurationPrefixes'] as $prefix) {
8
-			?>
5
+        $i = 1;
6
+        $sel = ' selected';
7
+        foreach ($_['serverConfigurationPrefixes'] as $prefix) {
8
+            ?>
9 9
 			<option value="<?php p($prefix); ?>"<?php p($sel);
10
-			$sel = ''; ?>><?php p($l->t('%s. Server:', [$i++])); ?> <?php p(' '.$_['serverConfigurationHosts'][$prefix]); ?></option>
10
+            $sel = ''; ?>><?php p($l->t('%s. Server:', [$i++])); ?> <?php p(' '.$_['serverConfigurationHosts'][$prefix]); ?></option>
11 11
 			<?php
12
-		}
13
-		?>
12
+        }
13
+        ?>
14 14
 		</select>
15 15
 		<button type="button" id="ldap_action_add_configuration"
16 16
 			name="ldap_action_add_configuration" class="icon-add icon-default-style"
Please login to merge, or discard this patch.
apps/user_ldap/ajax/setConfiguration.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -36,11 +36,11 @@
 block discarded – undo
36 36
 // only legacy checkboxes (Advanced and Expert tab) need to be handled here,
37 37
 // the Wizard-like tabs handle it on their own
38 38
 $chkboxes = ['ldap_configuration_active', 'ldap_override_main_server',
39
-	'ldap_turn_off_cert_check'];
39
+    'ldap_turn_off_cert_check'];
40 40
 foreach ($chkboxes as $boxid) {
41
-	if (!isset($_POST[$boxid])) {
42
-		$_POST[$boxid] = 0;
43
-	}
41
+    if (!isset($_POST[$boxid])) {
42
+        $_POST[$boxid] = 0;
43
+    }
44 44
 }
45 45
 
46 46
 $ldapWrapper = new OCA\User_LDAP\LDAP();
Please login to merge, or discard this patch.