Passed
Push — master ( 4908d8...fbbdc6 )
by Joas
16:12 queued 12s
created
lib/private/Security/CSRF/TokenStorage/SessionStorage.php 1 patch
Indentation   +49 added lines, -49 removed lines patch added patch discarded remove patch
@@ -35,59 +35,59 @@
 block discarded – undo
35 35
  * @package OC\Security\CSRF\TokenStorage
36 36
  */
37 37
 class SessionStorage {
38
-	/** @var ISession */
39
-	private $session;
38
+    /** @var ISession */
39
+    private $session;
40 40
 
41
-	/**
42
-	 * @param ISession $session
43
-	 */
44
-	public function __construct(ISession $session) {
45
-		$this->session = $session;
46
-	}
41
+    /**
42
+     * @param ISession $session
43
+     */
44
+    public function __construct(ISession $session) {
45
+        $this->session = $session;
46
+    }
47 47
 
48
-	/**
49
-	 * @param ISession $session
50
-	 */
51
-	public function setSession(ISession $session) {
52
-		$this->session = $session;
53
-	}
48
+    /**
49
+     * @param ISession $session
50
+     */
51
+    public function setSession(ISession $session) {
52
+        $this->session = $session;
53
+    }
54 54
 
55
-	/**
56
-	 * Returns the current token or throws an exception if none is found.
57
-	 *
58
-	 * @return string
59
-	 * @throws \Exception
60
-	 */
61
-	public function getToken(): string {
62
-		$token = $this->session->get('requesttoken');
63
-		if (empty($token)) {
64
-			throw new \Exception('Session does not contain a requesttoken');
65
-		}
55
+    /**
56
+     * Returns the current token or throws an exception if none is found.
57
+     *
58
+     * @return string
59
+     * @throws \Exception
60
+     */
61
+    public function getToken(): string {
62
+        $token = $this->session->get('requesttoken');
63
+        if (empty($token)) {
64
+            throw new \Exception('Session does not contain a requesttoken');
65
+        }
66 66
 
67
-		return $token;
68
-	}
67
+        return $token;
68
+    }
69 69
 
70
-	/**
71
-	 * Set the valid current token to $value.
72
-	 *
73
-	 * @param string $value
74
-	 */
75
-	public function setToken(string $value) {
76
-		$this->session->set('requesttoken', $value);
77
-	}
70
+    /**
71
+     * Set the valid current token to $value.
72
+     *
73
+     * @param string $value
74
+     */
75
+    public function setToken(string $value) {
76
+        $this->session->set('requesttoken', $value);
77
+    }
78 78
 
79
-	/**
80
-	 * Removes the current token.
81
-	 */
82
-	public function removeToken() {
83
-		$this->session->remove('requesttoken');
84
-	}
85
-	/**
86
-	 * Whether the storage has a storage.
87
-	 *
88
-	 * @return bool
89
-	 */
90
-	public function hasToken(): bool {
91
-		return $this->session->exists('requesttoken');
92
-	}
79
+    /**
80
+     * Removes the current token.
81
+     */
82
+    public function removeToken() {
83
+        $this->session->remove('requesttoken');
84
+    }
85
+    /**
86
+     * Whether the storage has a storage.
87
+     *
88
+     * @return bool
89
+     */
90
+    public function hasToken(): bool {
91
+        return $this->session->exists('requesttoken');
92
+    }
93 93
 }
Please login to merge, or discard this patch.
lib/private/Security/CSRF/CsrfTokenManager.php 1 patch
Indentation   +66 added lines, -66 removed lines patch added patch discarded remove patch
@@ -34,78 +34,78 @@
 block discarded – undo
34 34
  * @package OC\Security\CSRF
35 35
  */
36 36
 class CsrfTokenManager {
37
-	/** @var CsrfTokenGenerator */
38
-	private $tokenGenerator;
39
-	/** @var SessionStorage */
40
-	private $sessionStorage;
41
-	/** @var CsrfToken|null */
42
-	private $csrfToken = null;
37
+    /** @var CsrfTokenGenerator */
38
+    private $tokenGenerator;
39
+    /** @var SessionStorage */
40
+    private $sessionStorage;
41
+    /** @var CsrfToken|null */
42
+    private $csrfToken = null;
43 43
 
44
-	/**
45
-	 * @param CsrfTokenGenerator $tokenGenerator
46
-	 * @param SessionStorage $storageInterface
47
-	 */
48
-	public function __construct(CsrfTokenGenerator $tokenGenerator,
49
-								SessionStorage $storageInterface) {
50
-		$this->tokenGenerator = $tokenGenerator;
51
-		$this->sessionStorage = $storageInterface;
52
-	}
44
+    /**
45
+     * @param CsrfTokenGenerator $tokenGenerator
46
+     * @param SessionStorage $storageInterface
47
+     */
48
+    public function __construct(CsrfTokenGenerator $tokenGenerator,
49
+                                SessionStorage $storageInterface) {
50
+        $this->tokenGenerator = $tokenGenerator;
51
+        $this->sessionStorage = $storageInterface;
52
+    }
53 53
 
54
-	/**
55
-	 * Returns the current CSRF token, if none set it will create a new one.
56
-	 *
57
-	 * @return CsrfToken
58
-	 */
59
-	public function getToken(): CsrfToken {
60
-		if (!\is_null($this->csrfToken)) {
61
-			return $this->csrfToken;
62
-		}
54
+    /**
55
+     * Returns the current CSRF token, if none set it will create a new one.
56
+     *
57
+     * @return CsrfToken
58
+     */
59
+    public function getToken(): CsrfToken {
60
+        if (!\is_null($this->csrfToken)) {
61
+            return $this->csrfToken;
62
+        }
63 63
 
64
-		if ($this->sessionStorage->hasToken()) {
65
-			$value = $this->sessionStorage->getToken();
66
-		} else {
67
-			$value = $this->tokenGenerator->generateToken();
68
-			$this->sessionStorage->setToken($value);
69
-		}
64
+        if ($this->sessionStorage->hasToken()) {
65
+            $value = $this->sessionStorage->getToken();
66
+        } else {
67
+            $value = $this->tokenGenerator->generateToken();
68
+            $this->sessionStorage->setToken($value);
69
+        }
70 70
 
71
-		$this->csrfToken = new CsrfToken($value);
72
-		return $this->csrfToken;
73
-	}
71
+        $this->csrfToken = new CsrfToken($value);
72
+        return $this->csrfToken;
73
+    }
74 74
 
75
-	/**
76
-	 * Invalidates any current token and sets a new one.
77
-	 *
78
-	 * @return CsrfToken
79
-	 */
80
-	public function refreshToken(): CsrfToken {
81
-		$value = $this->tokenGenerator->generateToken();
82
-		$this->sessionStorage->setToken($value);
83
-		$this->csrfToken = new CsrfToken($value);
84
-		return $this->csrfToken;
85
-	}
75
+    /**
76
+     * Invalidates any current token and sets a new one.
77
+     *
78
+     * @return CsrfToken
79
+     */
80
+    public function refreshToken(): CsrfToken {
81
+        $value = $this->tokenGenerator->generateToken();
82
+        $this->sessionStorage->setToken($value);
83
+        $this->csrfToken = new CsrfToken($value);
84
+        return $this->csrfToken;
85
+    }
86 86
 
87
-	/**
88
-	 * Remove the current token from the storage.
89
-	 */
90
-	public function removeToken() {
91
-		$this->csrfToken = null;
92
-		$this->sessionStorage->removeToken();
93
-	}
87
+    /**
88
+     * Remove the current token from the storage.
89
+     */
90
+    public function removeToken() {
91
+        $this->csrfToken = null;
92
+        $this->sessionStorage->removeToken();
93
+    }
94 94
 
95
-	/**
96
-	 * Verifies whether the provided token is valid.
97
-	 *
98
-	 * @param CsrfToken $token
99
-	 * @return bool
100
-	 */
101
-	public function isTokenValid(CsrfToken $token): bool {
102
-		if (!$this->sessionStorage->hasToken()) {
103
-			return false;
104
-		}
95
+    /**
96
+     * Verifies whether the provided token is valid.
97
+     *
98
+     * @param CsrfToken $token
99
+     * @return bool
100
+     */
101
+    public function isTokenValid(CsrfToken $token): bool {
102
+        if (!$this->sessionStorage->hasToken()) {
103
+            return false;
104
+        }
105 105
 
106
-		return hash_equals(
107
-			$this->sessionStorage->getToken(),
108
-			$token->getDecryptedValue()
109
-		);
110
-	}
106
+        return hash_equals(
107
+            $this->sessionStorage->getToken(),
108
+            $token->getDecryptedValue()
109
+        );
110
+    }
111 111
 }
Please login to merge, or discard this patch.
lib/private/Command/QueueBus.php 1 patch
Indentation   +40 added lines, -40 removed lines patch added patch discarded remove patch
@@ -27,48 +27,48 @@
 block discarded – undo
27 27
 use OCP\Command\ICommand;
28 28
 
29 29
 class QueueBus implements IBus {
30
-	/**
31
-	 * @var ICommand[]|callable[]
32
-	 */
33
-	private $queue = [];
30
+    /**
31
+     * @var ICommand[]|callable[]
32
+     */
33
+    private $queue = [];
34 34
 
35
-	/**
36
-	 * Schedule a command to be fired
37
-	 *
38
-	 * @param \OCP\Command\ICommand | callable $command
39
-	 */
40
-	public function push($command) {
41
-		$this->queue[] = $command;
42
-	}
35
+    /**
36
+     * Schedule a command to be fired
37
+     *
38
+     * @param \OCP\Command\ICommand | callable $command
39
+     */
40
+    public function push($command) {
41
+        $this->queue[] = $command;
42
+    }
43 43
 
44
-	/**
45
-	 * Require all commands using a trait to be run synchronous
46
-	 *
47
-	 * @param string $trait
48
-	 */
49
-	public function requireSync($trait) {
50
-	}
44
+    /**
45
+     * Require all commands using a trait to be run synchronous
46
+     *
47
+     * @param string $trait
48
+     */
49
+    public function requireSync($trait) {
50
+    }
51 51
 
52
-	/**
53
-	 * @param \OCP\Command\ICommand | callable $command
54
-	 */
55
-	private function runCommand($command) {
56
-		if ($command instanceof ICommand) {
57
-			// ensure the command can be serialized
58
-			$serialized = serialize($command);
59
-			if (strlen($serialized) > 4000) {
60
-				throw new \InvalidArgumentException('Trying to push a command which serialized form can not be stored in the database (>4000 character)');
61
-			}
62
-			$unserialized = unserialize($serialized);
63
-			$unserialized->handle();
64
-		} else {
65
-			$command();
66
-		}
67
-	}
52
+    /**
53
+     * @param \OCP\Command\ICommand | callable $command
54
+     */
55
+    private function runCommand($command) {
56
+        if ($command instanceof ICommand) {
57
+            // ensure the command can be serialized
58
+            $serialized = serialize($command);
59
+            if (strlen($serialized) > 4000) {
60
+                throw new \InvalidArgumentException('Trying to push a command which serialized form can not be stored in the database (>4000 character)');
61
+            }
62
+            $unserialized = unserialize($serialized);
63
+            $unserialized->handle();
64
+        } else {
65
+            $command();
66
+        }
67
+    }
68 68
 
69
-	public function run() {
70
-		while ($command = array_shift($this->queue)) {
71
-			$this->runCommand($command);
72
-		}
73
-	}
69
+    public function run() {
70
+        while ($command = array_shift($this->queue)) {
71
+            $this->runCommand($command);
72
+        }
73
+    }
74 74
 }
Please login to merge, or discard this patch.
lib/private/OCS/Provider.php 1 patch
Indentation   +81 added lines, -81 removed lines patch added patch discarded remove patch
@@ -25,92 +25,92 @@
 block discarded – undo
25 25
 namespace OC\OCS;
26 26
 
27 27
 class Provider extends \OCP\AppFramework\Controller {
28
-	/** @var \OCP\App\IAppManager */
29
-	private $appManager;
28
+    /** @var \OCP\App\IAppManager */
29
+    private $appManager;
30 30
 
31
-	/**
32
-	 * @param string $appName
33
-	 * @param \OCP\IRequest $request
34
-	 * @param \OCP\App\IAppManager $appManager
35
-	 */
36
-	public function __construct($appName,
37
-								\OCP\IRequest $request,
38
-								\OCP\App\IAppManager $appManager) {
39
-		parent::__construct($appName, $request);
40
-		$this->appManager = $appManager;
41
-	}
31
+    /**
32
+     * @param string $appName
33
+     * @param \OCP\IRequest $request
34
+     * @param \OCP\App\IAppManager $appManager
35
+     */
36
+    public function __construct($appName,
37
+                                \OCP\IRequest $request,
38
+                                \OCP\App\IAppManager $appManager) {
39
+        parent::__construct($appName, $request);
40
+        $this->appManager = $appManager;
41
+    }
42 42
 
43
-	/**
44
-	 * @return \OCP\AppFramework\Http\JSONResponse
45
-	 */
46
-	public function buildProviderList() {
47
-		$services = [
48
-			'PRIVATE_DATA' => [
49
-				'version' => 1,
50
-				'endpoints' => [
51
-					'store' => '/ocs/v2.php/privatedata/setattribute',
52
-					'read' => '/ocs/v2.php/privatedata/getattribute',
53
-					'delete' => '/ocs/v2.php/privatedata/deleteattribute',
54
-				],
55
-			],
56
-		];
43
+    /**
44
+     * @return \OCP\AppFramework\Http\JSONResponse
45
+     */
46
+    public function buildProviderList() {
47
+        $services = [
48
+            'PRIVATE_DATA' => [
49
+                'version' => 1,
50
+                'endpoints' => [
51
+                    'store' => '/ocs/v2.php/privatedata/setattribute',
52
+                    'read' => '/ocs/v2.php/privatedata/getattribute',
53
+                    'delete' => '/ocs/v2.php/privatedata/deleteattribute',
54
+                ],
55
+            ],
56
+        ];
57 57
 
58
-		if ($this->appManager->isEnabledForUser('files_sharing')) {
59
-			$services['SHARING'] = [
60
-				'version' => 1,
61
-				'endpoints' => [
62
-					'share' => '/ocs/v2.php/apps/files_sharing/api/v1/shares',
63
-				],
64
-			];
65
-			$services['FEDERATED_SHARING'] = [
66
-				'version' => 1,
67
-				'endpoints' => [
68
-					'share' => '/ocs/v2.php/cloud/shares',
69
-					'webdav' => '/public.php/webdav/',
70
-				],
71
-			];
72
-		}
58
+        if ($this->appManager->isEnabledForUser('files_sharing')) {
59
+            $services['SHARING'] = [
60
+                'version' => 1,
61
+                'endpoints' => [
62
+                    'share' => '/ocs/v2.php/apps/files_sharing/api/v1/shares',
63
+                ],
64
+            ];
65
+            $services['FEDERATED_SHARING'] = [
66
+                'version' => 1,
67
+                'endpoints' => [
68
+                    'share' => '/ocs/v2.php/cloud/shares',
69
+                    'webdav' => '/public.php/webdav/',
70
+                ],
71
+            ];
72
+        }
73 73
 
74
-		if ($this->appManager->isEnabledForUser('federation')) {
75
-			if (isset($services['FEDERATED_SHARING'])) {
76
-				$services['FEDERATED_SHARING']['endpoints']['shared-secret'] = '/ocs/v2.php/cloud/shared-secret';
77
-				$services['FEDERATED_SHARING']['endpoints']['system-address-book'] = '/remote.php/dav/addressbooks/system/system/system';
78
-				$services['FEDERATED_SHARING']['endpoints']['carddav-user'] = 'system';
79
-			} else {
80
-				$services['FEDERATED_SHARING'] = [
81
-					'version' => 1,
82
-					'endpoints' => [
83
-						'shared-secret' => '/ocs/v2.php/cloud/shared-secret',
84
-						'system-address-book' => '/remote.php/dav/addressbooks/system/system/system',
85
-						'carddav-user' => 'system'
86
-					],
87
-				];
88
-			}
89
-		}
74
+        if ($this->appManager->isEnabledForUser('federation')) {
75
+            if (isset($services['FEDERATED_SHARING'])) {
76
+                $services['FEDERATED_SHARING']['endpoints']['shared-secret'] = '/ocs/v2.php/cloud/shared-secret';
77
+                $services['FEDERATED_SHARING']['endpoints']['system-address-book'] = '/remote.php/dav/addressbooks/system/system/system';
78
+                $services['FEDERATED_SHARING']['endpoints']['carddav-user'] = 'system';
79
+            } else {
80
+                $services['FEDERATED_SHARING'] = [
81
+                    'version' => 1,
82
+                    'endpoints' => [
83
+                        'shared-secret' => '/ocs/v2.php/cloud/shared-secret',
84
+                        'system-address-book' => '/remote.php/dav/addressbooks/system/system/system',
85
+                        'carddav-user' => 'system'
86
+                    ],
87
+                ];
88
+            }
89
+        }
90 90
 
91
-		if ($this->appManager->isEnabledForUser('activity')) {
92
-			$services['ACTIVITY'] = [
93
-				'version' => 1,
94
-				'endpoints' => [
95
-					'list' => '/ocs/v2.php/cloud/activity',
96
-				],
97
-			];
98
-		}
91
+        if ($this->appManager->isEnabledForUser('activity')) {
92
+            $services['ACTIVITY'] = [
93
+                'version' => 1,
94
+                'endpoints' => [
95
+                    'list' => '/ocs/v2.php/cloud/activity',
96
+                ],
97
+            ];
98
+        }
99 99
 
100
-		if ($this->appManager->isEnabledForUser('provisioning_api')) {
101
-			$services['PROVISIONING'] = [
102
-				'version' => 1,
103
-				'endpoints' => [
104
-					'user' => '/ocs/v2.php/cloud/users',
105
-					'groups' => '/ocs/v2.php/cloud/groups',
106
-					'apps' => '/ocs/v2.php/cloud/apps',
107
-				],
108
-			];
109
-		}
100
+        if ($this->appManager->isEnabledForUser('provisioning_api')) {
101
+            $services['PROVISIONING'] = [
102
+                'version' => 1,
103
+                'endpoints' => [
104
+                    'user' => '/ocs/v2.php/cloud/users',
105
+                    'groups' => '/ocs/v2.php/cloud/groups',
106
+                    'apps' => '/ocs/v2.php/cloud/apps',
107
+                ],
108
+            ];
109
+        }
110 110
 
111
-		return new \OCP\AppFramework\Http\JSONResponse([
112
-			'version' => 2,
113
-			'services' => $services,
114
-		]);
115
-	}
111
+        return new \OCP\AppFramework\Http\JSONResponse([
112
+            'version' => 2,
113
+            'services' => $services,
114
+        ]);
115
+    }
116 116
 }
Please login to merge, or discard this patch.
lib/private/Authentication/Exceptions/InvalidProviderException.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@
 block discarded – undo
30 30
 use Throwable;
31 31
 
32 32
 class InvalidProviderException extends Exception {
33
-	public function __construct(string $providerId, Throwable $previous = null) {
34
-		parent::__construct("The provider '$providerId' does not exist'", 0, $previous);
35
-	}
33
+    public function __construct(string $providerId, Throwable $previous = null) {
34
+        parent::__construct("The provider '$providerId' does not exist'", 0, $previous);
35
+    }
36 36
 }
Please login to merge, or discard this patch.
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.
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.