Passed
Push — master ( 0f9b88...fa914f )
by Roeland
14:25 queued 12s
created
apps/federation/lib/DAV/FedAuth.php 1 patch
Indentation   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -29,40 +29,40 @@
 block discarded – undo
29 29
 
30 30
 class FedAuth extends AbstractBasic {
31 31
 
32
-	/** @var DbHandler */
33
-	private $db;
32
+    /** @var DbHandler */
33
+    private $db;
34 34
 
35
-	/**
36
-	 * FedAuth constructor.
37
-	 *
38
-	 * @param DbHandler $db
39
-	 */
40
-	public function __construct(DbHandler $db) {
41
-		$this->db = $db;
42
-		$this->principalPrefix = 'principals/system/';
35
+    /**
36
+     * FedAuth constructor.
37
+     *
38
+     * @param DbHandler $db
39
+     */
40
+    public function __construct(DbHandler $db) {
41
+        $this->db = $db;
42
+        $this->principalPrefix = 'principals/system/';
43 43
 
44
-		// setup realm
45
-		$defaults = new \OCP\Defaults();
46
-		$this->realm = $defaults->getName();
47
-	}
44
+        // setup realm
45
+        $defaults = new \OCP\Defaults();
46
+        $this->realm = $defaults->getName();
47
+    }
48 48
 
49
-	/**
50
-	 * Validates a username and password
51
-	 *
52
-	 * This method should return true or false depending on if login
53
-	 * succeeded.
54
-	 *
55
-	 * @param string $username
56
-	 * @param string $password
57
-	 * @return bool
58
-	 */
59
-	protected function validateUserPass($username, $password) {
60
-		return $this->db->auth($username, $password);
61
-	}
49
+    /**
50
+     * Validates a username and password
51
+     *
52
+     * This method should return true or false depending on if login
53
+     * succeeded.
54
+     *
55
+     * @param string $username
56
+     * @param string $password
57
+     * @return bool
58
+     */
59
+    protected function validateUserPass($username, $password) {
60
+        return $this->db->auth($username, $password);
61
+    }
62 62
 
63
-	/**
64
-	 * @inheritdoc
65
-	 */
66
-	public function challenge(RequestInterface $request, ResponseInterface $response) {
67
-	}
63
+    /**
64
+     * @inheritdoc
65
+     */
66
+    public function challenge(RequestInterface $request, ResponseInterface $response) {
67
+    }
68 68
 }
Please login to merge, or discard this patch.
apps/federation/lib/Controller/OCSAuthAPIController.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
 	 */
135 135
 	public function requestSharedSecret($url, $token) {
136 136
 		if ($this->trustedServers->isTrustedServer($url) === false) {
137
-			$this->logger->error('remote server not trusted (' . $url . ') while requesting shared secret', ['app' => 'federation']);
137
+			$this->logger->error('remote server not trusted ('.$url.') while requesting shared secret', ['app' => 'federation']);
138 138
 			throw new OCSForbiddenException();
139 139
 		}
140 140
 
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
 		$localToken = $this->dbHandler->getToken($url);
144 144
 		if (strcmp($localToken, $token) > 0) {
145 145
 			$this->logger->info(
146
-				'remote server (' . $url . ') presented lower token. We will initiate the exchange of the shared secret.',
146
+				'remote server ('.$url.') presented lower token. We will initiate the exchange of the shared secret.',
147 147
 				['app' => 'federation']
148 148
 			);
149 149
 			throw new OCSForbiddenException();
@@ -183,14 +183,14 @@  discard block
 block discarded – undo
183 183
 	 */
184 184
 	public function getSharedSecret($url, $token) {
185 185
 		if ($this->trustedServers->isTrustedServer($url) === false) {
186
-			$this->logger->error('remote server not trusted (' . $url . ') while getting shared secret', ['app' => 'federation']);
186
+			$this->logger->error('remote server not trusted ('.$url.') while getting shared secret', ['app' => 'federation']);
187 187
 			throw new OCSForbiddenException();
188 188
 		}
189 189
 
190 190
 		if ($this->isValidToken($url, $token) === false) {
191 191
 			$expectedToken = $this->dbHandler->getToken($url);
192 192
 			$this->logger->error(
193
-				'remote server (' . $url . ') didn\'t send a valid token (got "' . $token . '" but expected "'. $expectedToken . '") while getting shared secret',
193
+				'remote server ('.$url.') didn\'t send a valid token (got "'.$token.'" but expected "'.$expectedToken.'") while getting shared secret',
194 194
 				['app' => 'federation']
195 195
 			);
196 196
 			throw new OCSForbiddenException();
Please login to merge, or discard this patch.
Indentation   +160 added lines, -160 removed lines patch added patch discarded remove patch
@@ -48,164 +48,164 @@
 block discarded – undo
48 48
  */
49 49
 class OCSAuthAPIController extends OCSController {
50 50
 
51
-	/** @var ISecureRandom  */
52
-	private $secureRandom;
53
-
54
-	/** @var IJobList */
55
-	private $jobList;
56
-
57
-	/** @var TrustedServers */
58
-	private $trustedServers;
59
-
60
-	/** @var DbHandler */
61
-	private $dbHandler;
62
-
63
-	/** @var ILogger */
64
-	private $logger;
65
-
66
-	/** @var ITimeFactory */
67
-	private $timeFactory;
68
-
69
-	/**
70
-	 * OCSAuthAPI constructor.
71
-	 *
72
-	 * @param string $appName
73
-	 * @param IRequest $request
74
-	 * @param ISecureRandom $secureRandom
75
-	 * @param IJobList $jobList
76
-	 * @param TrustedServers $trustedServers
77
-	 * @param DbHandler $dbHandler
78
-	 * @param ILogger $logger
79
-	 * @param ITimeFactory $timeFactory
80
-	 */
81
-	public function __construct(
82
-		$appName,
83
-		IRequest $request,
84
-		ISecureRandom $secureRandom,
85
-		IJobList $jobList,
86
-		TrustedServers $trustedServers,
87
-		DbHandler $dbHandler,
88
-		ILogger $logger,
89
-		ITimeFactory $timeFactory
90
-	) {
91
-		parent::__construct($appName, $request);
92
-
93
-		$this->secureRandom = $secureRandom;
94
-		$this->jobList = $jobList;
95
-		$this->trustedServers = $trustedServers;
96
-		$this->dbHandler = $dbHandler;
97
-		$this->logger = $logger;
98
-		$this->timeFactory = $timeFactory;
99
-	}
100
-
101
-	/**
102
-	 * @NoCSRFRequired
103
-	 * @PublicPage
104
-	 *
105
-	 * request received to ask remote server for a shared secret, for legacy end-points
106
-	 *
107
-	 * @param string $url
108
-	 * @param string $token
109
-	 * @return Http\DataResponse
110
-	 * @throws OCSForbiddenException
111
-	 */
112
-	public function requestSharedSecretLegacy($url, $token) {
113
-		return $this->requestSharedSecret($url, $token);
114
-	}
115
-
116
-
117
-	/**
118
-	 * @NoCSRFRequired
119
-	 * @PublicPage
120
-	 *
121
-	 * create shared secret and return it, for legacy end-points
122
-	 *
123
-	 * @param string $url
124
-	 * @param string $token
125
-	 * @return Http\DataResponse
126
-	 * @throws OCSForbiddenException
127
-	 */
128
-	public function getSharedSecretLegacy($url, $token) {
129
-		return $this->getSharedSecret($url, $token);
130
-	}
131
-
132
-	/**
133
-	 * @NoCSRFRequired
134
-	 * @PublicPage
135
-	 *
136
-	 * request received to ask remote server for a shared secret
137
-	 *
138
-	 * @param string $url
139
-	 * @param string $token
140
-	 * @return Http\DataResponse
141
-	 * @throws OCSForbiddenException
142
-	 */
143
-	public function requestSharedSecret($url, $token) {
144
-		if ($this->trustedServers->isTrustedServer($url) === false) {
145
-			$this->logger->error('remote server not trusted (' . $url . ') while requesting shared secret', ['app' => 'federation']);
146
-			throw new OCSForbiddenException();
147
-		}
148
-
149
-		// if both server initiated the exchange of the shared secret the greater
150
-		// token wins
151
-		$localToken = $this->dbHandler->getToken($url);
152
-		if (strcmp($localToken, $token) > 0) {
153
-			$this->logger->info(
154
-				'remote server (' . $url . ') presented lower token. We will initiate the exchange of the shared secret.',
155
-				['app' => 'federation']
156
-			);
157
-			throw new OCSForbiddenException();
158
-		}
159
-
160
-		$this->jobList->add(
161
-			'OCA\Federation\BackgroundJob\GetSharedSecret',
162
-			[
163
-				'url' => $url,
164
-				'token' => $token,
165
-				'created' => $this->timeFactory->getTime()
166
-			]
167
-		);
168
-
169
-		return new Http\DataResponse();
170
-	}
171
-
172
-	/**
173
-	 * @NoCSRFRequired
174
-	 * @PublicPage
175
-	 *
176
-	 * create shared secret and return it
177
-	 *
178
-	 * @param string $url
179
-	 * @param string $token
180
-	 * @return Http\DataResponse
181
-	 * @throws OCSForbiddenException
182
-	 */
183
-	public function getSharedSecret($url, $token) {
184
-		if ($this->trustedServers->isTrustedServer($url) === false) {
185
-			$this->logger->error('remote server not trusted (' . $url . ') while getting shared secret', ['app' => 'federation']);
186
-			throw new OCSForbiddenException();
187
-		}
188
-
189
-		if ($this->isValidToken($url, $token) === false) {
190
-			$expectedToken = $this->dbHandler->getToken($url);
191
-			$this->logger->error(
192
-				'remote server (' . $url . ') didn\'t send a valid token (got "' . $token . '" but expected "'. $expectedToken . '") while getting shared secret',
193
-				['app' => 'federation']
194
-			);
195
-			throw new OCSForbiddenException();
196
-		}
197
-
198
-		$sharedSecret = $this->secureRandom->generate(32);
199
-
200
-		$this->trustedServers->addSharedSecret($url, $sharedSecret);
201
-
202
-		return new Http\DataResponse([
203
-			'sharedSecret' => $sharedSecret
204
-		]);
205
-	}
206
-
207
-	protected function isValidToken($url, $token) {
208
-		$storedToken = $this->dbHandler->getToken($url);
209
-		return hash_equals($storedToken, $token);
210
-	}
51
+    /** @var ISecureRandom  */
52
+    private $secureRandom;
53
+
54
+    /** @var IJobList */
55
+    private $jobList;
56
+
57
+    /** @var TrustedServers */
58
+    private $trustedServers;
59
+
60
+    /** @var DbHandler */
61
+    private $dbHandler;
62
+
63
+    /** @var ILogger */
64
+    private $logger;
65
+
66
+    /** @var ITimeFactory */
67
+    private $timeFactory;
68
+
69
+    /**
70
+     * OCSAuthAPI constructor.
71
+     *
72
+     * @param string $appName
73
+     * @param IRequest $request
74
+     * @param ISecureRandom $secureRandom
75
+     * @param IJobList $jobList
76
+     * @param TrustedServers $trustedServers
77
+     * @param DbHandler $dbHandler
78
+     * @param ILogger $logger
79
+     * @param ITimeFactory $timeFactory
80
+     */
81
+    public function __construct(
82
+        $appName,
83
+        IRequest $request,
84
+        ISecureRandom $secureRandom,
85
+        IJobList $jobList,
86
+        TrustedServers $trustedServers,
87
+        DbHandler $dbHandler,
88
+        ILogger $logger,
89
+        ITimeFactory $timeFactory
90
+    ) {
91
+        parent::__construct($appName, $request);
92
+
93
+        $this->secureRandom = $secureRandom;
94
+        $this->jobList = $jobList;
95
+        $this->trustedServers = $trustedServers;
96
+        $this->dbHandler = $dbHandler;
97
+        $this->logger = $logger;
98
+        $this->timeFactory = $timeFactory;
99
+    }
100
+
101
+    /**
102
+     * @NoCSRFRequired
103
+     * @PublicPage
104
+     *
105
+     * request received to ask remote server for a shared secret, for legacy end-points
106
+     *
107
+     * @param string $url
108
+     * @param string $token
109
+     * @return Http\DataResponse
110
+     * @throws OCSForbiddenException
111
+     */
112
+    public function requestSharedSecretLegacy($url, $token) {
113
+        return $this->requestSharedSecret($url, $token);
114
+    }
115
+
116
+
117
+    /**
118
+     * @NoCSRFRequired
119
+     * @PublicPage
120
+     *
121
+     * create shared secret and return it, for legacy end-points
122
+     *
123
+     * @param string $url
124
+     * @param string $token
125
+     * @return Http\DataResponse
126
+     * @throws OCSForbiddenException
127
+     */
128
+    public function getSharedSecretLegacy($url, $token) {
129
+        return $this->getSharedSecret($url, $token);
130
+    }
131
+
132
+    /**
133
+     * @NoCSRFRequired
134
+     * @PublicPage
135
+     *
136
+     * request received to ask remote server for a shared secret
137
+     *
138
+     * @param string $url
139
+     * @param string $token
140
+     * @return Http\DataResponse
141
+     * @throws OCSForbiddenException
142
+     */
143
+    public function requestSharedSecret($url, $token) {
144
+        if ($this->trustedServers->isTrustedServer($url) === false) {
145
+            $this->logger->error('remote server not trusted (' . $url . ') while requesting shared secret', ['app' => 'federation']);
146
+            throw new OCSForbiddenException();
147
+        }
148
+
149
+        // if both server initiated the exchange of the shared secret the greater
150
+        // token wins
151
+        $localToken = $this->dbHandler->getToken($url);
152
+        if (strcmp($localToken, $token) > 0) {
153
+            $this->logger->info(
154
+                'remote server (' . $url . ') presented lower token. We will initiate the exchange of the shared secret.',
155
+                ['app' => 'federation']
156
+            );
157
+            throw new OCSForbiddenException();
158
+        }
159
+
160
+        $this->jobList->add(
161
+            'OCA\Federation\BackgroundJob\GetSharedSecret',
162
+            [
163
+                'url' => $url,
164
+                'token' => $token,
165
+                'created' => $this->timeFactory->getTime()
166
+            ]
167
+        );
168
+
169
+        return new Http\DataResponse();
170
+    }
171
+
172
+    /**
173
+     * @NoCSRFRequired
174
+     * @PublicPage
175
+     *
176
+     * create shared secret and return it
177
+     *
178
+     * @param string $url
179
+     * @param string $token
180
+     * @return Http\DataResponse
181
+     * @throws OCSForbiddenException
182
+     */
183
+    public function getSharedSecret($url, $token) {
184
+        if ($this->trustedServers->isTrustedServer($url) === false) {
185
+            $this->logger->error('remote server not trusted (' . $url . ') while getting shared secret', ['app' => 'federation']);
186
+            throw new OCSForbiddenException();
187
+        }
188
+
189
+        if ($this->isValidToken($url, $token) === false) {
190
+            $expectedToken = $this->dbHandler->getToken($url);
191
+            $this->logger->error(
192
+                'remote server (' . $url . ') didn\'t send a valid token (got "' . $token . '" but expected "'. $expectedToken . '") while getting shared secret',
193
+                ['app' => 'federation']
194
+            );
195
+            throw new OCSForbiddenException();
196
+        }
197
+
198
+        $sharedSecret = $this->secureRandom->generate(32);
199
+
200
+        $this->trustedServers->addSharedSecret($url, $sharedSecret);
201
+
202
+        return new Http\DataResponse([
203
+            'sharedSecret' => $sharedSecret
204
+        ]);
205
+    }
206
+
207
+    protected function isValidToken($url, $token) {
208
+        $storedToken = $this->dbHandler->getToken($url);
209
+        return hash_equals($storedToken, $token);
210
+    }
211 211
 }
Please login to merge, or discard this patch.
apps/systemtags/lib/Controller/LastUsedController.php 2 patches
Indentation   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -29,32 +29,32 @@
 block discarded – undo
29 29
 
30 30
 class LastUsedController extends Controller {
31 31
 
32
-	/** @var IConfig */
33
-	protected $config;
32
+    /** @var IConfig */
33
+    protected $config;
34 34
 
35
-	/** @var IUserSession */
36
-	protected $userSession;
35
+    /** @var IUserSession */
36
+    protected $userSession;
37 37
 
38
-	/**
39
-	 * @param string $appName
40
-	 * @param IRequest $request
41
-	 * @param IConfig $config
42
-	 * @param IUserSession $userSession
43
-	 */
44
-	public function __construct($appName, IRequest $request, IConfig $config, IUserSession $userSession) {
45
-		parent::__construct($appName, $request);
46
-		$this->config = $config;
47
-		$this->userSession = $userSession;
48
-	}
38
+    /**
39
+     * @param string $appName
40
+     * @param IRequest $request
41
+     * @param IConfig $config
42
+     * @param IUserSession $userSession
43
+     */
44
+    public function __construct($appName, IRequest $request, IConfig $config, IUserSession $userSession) {
45
+        parent::__construct($appName, $request);
46
+        $this->config = $config;
47
+        $this->userSession = $userSession;
48
+    }
49 49
 
50
-	/**
51
-	 * @NoAdminRequired
52
-	 */
53
-	public function getLastUsedTagIds() {
54
-		$lastUsed = $this->config->getUserValue($this->userSession->getUser()->getUID(), 'systemtags', 'last_used', '[]');
55
-		$tagIds = json_decode($lastUsed, true);
56
-		return new DataResponse(array_map(function ($id) {
57
-			return (string) $id;
58
-		}, $tagIds));
59
-	}
50
+    /**
51
+     * @NoAdminRequired
52
+     */
53
+    public function getLastUsedTagIds() {
54
+        $lastUsed = $this->config->getUserValue($this->userSession->getUser()->getUID(), 'systemtags', 'last_used', '[]');
55
+        $tagIds = json_decode($lastUsed, true);
56
+        return new DataResponse(array_map(function ($id) {
57
+            return (string) $id;
58
+        }, $tagIds));
59
+    }
60 60
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -53,7 +53,7 @@
 block discarded – undo
53 53
 	public function getLastUsedTagIds() {
54 54
 		$lastUsed = $this->config->getUserValue($this->userSession->getUser()->getUID(), 'systemtags', 'last_used', '[]');
55 55
 		$tagIds = json_decode($lastUsed, true);
56
-		return new DataResponse(array_map(function ($id) {
56
+		return new DataResponse(array_map(function($id) {
57 57
 			return (string) $id;
58 58
 		}, $tagIds));
59 59
 	}
Please login to merge, or discard this patch.
apps/federatedfilesharing/lib/BackgroundJob/RetryJob.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
 		$token = $argument['token'];
98 98
 		$action = $argument['action'];
99 99
 		$data = json_decode($argument['data'], true);
100
-		$try = (int)$argument['try'] + 1;
100
+		$try = (int) $argument['try'] + 1;
101 101
 
102 102
 		$result = $this->notifications->sendUpdateToRemote($remote, $remoteId, $token, $action, $data, $try);
103 103
 
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
 				'token' => $argument['token'],
122 122
 				'data' => $argument['data'],
123 123
 				'action' => $argument['action'],
124
-				'try' => (int)$argument['try'] + 1,
124
+				'try' => (int) $argument['try'] + 1,
125 125
 				'lastRun' => time()
126 126
 			]
127 127
 		);
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
 	 * @return bool
135 135
 	 */
136 136
 	protected function shouldRun(array $argument) {
137
-		$lastRun = (int)$argument['lastRun'];
137
+		$lastRun = (int) $argument['lastRun'];
138 138
 		return ((time() - $lastRun) > $this->interval);
139 139
 	}
140 140
 }
Please login to merge, or discard this patch.
Indentation   +88 added lines, -88 removed lines patch added patch discarded remove patch
@@ -44,102 +44,102 @@
 block discarded – undo
44 44
  */
45 45
 class RetryJob extends Job {
46 46
 
47
-	/** @var  bool */
48
-	private $retainJob = true;
47
+    /** @var  bool */
48
+    private $retainJob = true;
49 49
 
50
-	/** @var Notifications */
51
-	private $notifications;
50
+    /** @var Notifications */
51
+    private $notifications;
52 52
 
53
-	/** @var int max number of attempts to send the request */
54
-	private $maxTry = 20;
53
+    /** @var int max number of attempts to send the request */
54
+    private $maxTry = 20;
55 55
 
56
-	/** @var int how much time should be between two tries (10 minutes) */
57
-	private $interval = 600;
56
+    /** @var int how much time should be between two tries (10 minutes) */
57
+    private $interval = 600;
58 58
 
59
-	/**
60
-	 * UnShare constructor.
61
-	 *
62
-	 * @param Notifications $notifications
63
-	 */
64
-	public function __construct(Notifications $notifications = null) {
65
-		if ($notifications) {
66
-			$this->notifications = $notifications;
67
-		} else {
68
-			$addressHandler = new AddressHandler(
69
-				\OC::$server->getURLGenerator(),
70
-				\OC::$server->getL10N('federatedfilesharing'),
71
-				\OC::$server->getCloudIdManager()
72
-			);
73
-			$this->notifications = new Notifications(
74
-				$addressHandler,
75
-				\OC::$server->getHTTPClientService(),
76
-				\OC::$server->query(\OCP\OCS\IDiscoveryService::class),
77
-				\OC::$server->getJobList(),
78
-				\OC::$server->getCloudFederationProviderManager(),
79
-				\OC::$server->getCloudFederationFactory()
80
-			);
81
-		}
82
-	}
59
+    /**
60
+     * UnShare constructor.
61
+     *
62
+     * @param Notifications $notifications
63
+     */
64
+    public function __construct(Notifications $notifications = null) {
65
+        if ($notifications) {
66
+            $this->notifications = $notifications;
67
+        } else {
68
+            $addressHandler = new AddressHandler(
69
+                \OC::$server->getURLGenerator(),
70
+                \OC::$server->getL10N('federatedfilesharing'),
71
+                \OC::$server->getCloudIdManager()
72
+            );
73
+            $this->notifications = new Notifications(
74
+                $addressHandler,
75
+                \OC::$server->getHTTPClientService(),
76
+                \OC::$server->query(\OCP\OCS\IDiscoveryService::class),
77
+                \OC::$server->getJobList(),
78
+                \OC::$server->getCloudFederationProviderManager(),
79
+                \OC::$server->getCloudFederationFactory()
80
+            );
81
+        }
82
+    }
83 83
 
84
-	/**
85
-	 * run the job, then remove it from the jobList
86
-	 *
87
-	 * @param JobList $jobList
88
-	 * @param ILogger|null $logger
89
-	 */
90
-	public function execute($jobList, ILogger $logger = null) {
91
-		if ($this->shouldRun($this->argument)) {
92
-			parent::execute($jobList, $logger);
93
-			$jobList->remove($this, $this->argument);
94
-			if ($this->retainJob) {
95
-				$this->reAddJob($jobList, $this->argument);
96
-			}
97
-		}
98
-	}
84
+    /**
85
+     * run the job, then remove it from the jobList
86
+     *
87
+     * @param JobList $jobList
88
+     * @param ILogger|null $logger
89
+     */
90
+    public function execute($jobList, ILogger $logger = null) {
91
+        if ($this->shouldRun($this->argument)) {
92
+            parent::execute($jobList, $logger);
93
+            $jobList->remove($this, $this->argument);
94
+            if ($this->retainJob) {
95
+                $this->reAddJob($jobList, $this->argument);
96
+            }
97
+        }
98
+    }
99 99
 
100
-	protected function run($argument) {
101
-		$remote = $argument['remote'];
102
-		$remoteId = $argument['remoteId'];
103
-		$token = $argument['token'];
104
-		$action = $argument['action'];
105
-		$data = json_decode($argument['data'], true);
106
-		$try = (int)$argument['try'] + 1;
100
+    protected function run($argument) {
101
+        $remote = $argument['remote'];
102
+        $remoteId = $argument['remoteId'];
103
+        $token = $argument['token'];
104
+        $action = $argument['action'];
105
+        $data = json_decode($argument['data'], true);
106
+        $try = (int)$argument['try'] + 1;
107 107
 
108
-		$result = $this->notifications->sendUpdateToRemote($remote, $remoteId, $token, $action, $data, $try);
108
+        $result = $this->notifications->sendUpdateToRemote($remote, $remoteId, $token, $action, $data, $try);
109 109
 
110
-		if ($result === true || $try > $this->maxTry) {
111
-			$this->retainJob = false;
112
-		}
113
-	}
110
+        if ($result === true || $try > $this->maxTry) {
111
+            $this->retainJob = false;
112
+        }
113
+    }
114 114
 
115
-	/**
116
-	 * re-add background job with new arguments
117
-	 *
118
-	 * @param IJobList $jobList
119
-	 * @param array $argument
120
-	 */
121
-	protected function reAddJob(IJobList $jobList, array $argument) {
122
-		$jobList->add(RetryJob::class,
123
-			[
124
-				'remote' => $argument['remote'],
125
-				'remoteId' => $argument['remoteId'],
126
-				'token' => $argument['token'],
127
-				'data' => $argument['data'],
128
-				'action' => $argument['action'],
129
-				'try' => (int)$argument['try'] + 1,
130
-				'lastRun' => time()
131
-			]
132
-		);
133
-	}
115
+    /**
116
+     * re-add background job with new arguments
117
+     *
118
+     * @param IJobList $jobList
119
+     * @param array $argument
120
+     */
121
+    protected function reAddJob(IJobList $jobList, array $argument) {
122
+        $jobList->add(RetryJob::class,
123
+            [
124
+                'remote' => $argument['remote'],
125
+                'remoteId' => $argument['remoteId'],
126
+                'token' => $argument['token'],
127
+                'data' => $argument['data'],
128
+                'action' => $argument['action'],
129
+                'try' => (int)$argument['try'] + 1,
130
+                'lastRun' => time()
131
+            ]
132
+        );
133
+    }
134 134
 
135
-	/**
136
-	 * test if it is time for the next run
137
-	 *
138
-	 * @param array $argument
139
-	 * @return bool
140
-	 */
141
-	protected function shouldRun(array $argument) {
142
-		$lastRun = (int)$argument['lastRun'];
143
-		return ((time() - $lastRun) > $this->interval);
144
-	}
135
+    /**
136
+     * test if it is time for the next run
137
+     *
138
+     * @param array $argument
139
+     * @return bool
140
+     */
141
+    protected function shouldRun(array $argument) {
142
+        $lastRun = (int)$argument['lastRun'];
143
+        return ((time() - $lastRun) > $this->interval);
144
+    }
145 145
 }
Please login to merge, or discard this patch.
apps/files_trashbin/lib/Command/Expire.php 1 patch
Indentation   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -31,30 +31,30 @@
 block discarded – undo
31 31
 use OCP\Command\ICommand;
32 32
 
33 33
 class Expire implements ICommand {
34
-	use FileAccess;
34
+    use FileAccess;
35 35
 
36
-	/**
37
-	 * @var string
38
-	 */
39
-	private $user;
36
+    /**
37
+     * @var string
38
+     */
39
+    private $user;
40 40
 
41
-	/**
42
-	 * @param string $user
43
-	 */
44
-	public function __construct($user) {
45
-		$this->user = $user;
46
-	}
41
+    /**
42
+     * @param string $user
43
+     */
44
+    public function __construct($user) {
45
+        $this->user = $user;
46
+    }
47 47
 
48
-	public function handle() {
49
-		$userManager = \OC::$server->getUserManager();
50
-		if (!$userManager->userExists($this->user)) {
51
-			// User has been deleted already
52
-			return;
53
-		}
48
+    public function handle() {
49
+        $userManager = \OC::$server->getUserManager();
50
+        if (!$userManager->userExists($this->user)) {
51
+            // User has been deleted already
52
+            return;
53
+        }
54 54
 
55
-		\OC_Util::tearDownFS();
56
-		\OC_Util::setupFS($this->user);
57
-		Trashbin::expire($this->user);
58
-		\OC_Util::tearDownFS();
59
-	}
55
+        \OC_Util::tearDownFS();
56
+        \OC_Util::setupFS($this->user);
57
+        Trashbin::expire($this->user);
58
+        \OC_Util::tearDownFS();
59
+    }
60 60
 }
Please login to merge, or discard this patch.
apps/files_trashbin/lib/Command/ExpireTrash.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
 		} else {
91 91
 			$p = new ProgressBar($output);
92 92
 			$p->start();
93
-			$this->userManager->callForSeenUsers(function (IUser $user) use ($p) {
93
+			$this->userManager->callForSeenUsers(function(IUser $user) use ($p) {
94 94
 				$p->advance();
95 95
 				$this->expireTrashForUser($user);
96 96
 			});
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
 		\OC_Util::setupFS($user);
119 119
 
120 120
 		// Check if this user has a trashbin directory
121
-		$view = new \OC\Files\View('/' . $user);
121
+		$view = new \OC\Files\View('/'.$user);
122 122
 		if (!$view->is_dir('/files_trashbin/files')) {
123 123
 			return false;
124 124
 		}
Please login to merge, or discard this patch.
Indentation   +79 added lines, -79 removed lines patch added patch discarded remove patch
@@ -37,93 +37,93 @@
 block discarded – undo
37 37
 
38 38
 class ExpireTrash extends Command {
39 39
 
40
-	/**
41
-	 * @var Expiration
42
-	 */
43
-	private $expiration;
40
+    /**
41
+     * @var Expiration
42
+     */
43
+    private $expiration;
44 44
 	
45
-	/**
46
-	 * @var IUserManager
47
-	 */
48
-	private $userManager;
45
+    /**
46
+     * @var IUserManager
47
+     */
48
+    private $userManager;
49 49
 
50
-	/**
51
-	 * @param IUserManager|null $userManager
52
-	 * @param Expiration|null $expiration
53
-	 */
54
-	public function __construct(IUserManager $userManager = null,
55
-								Expiration $expiration = null) {
56
-		parent::__construct();
50
+    /**
51
+     * @param IUserManager|null $userManager
52
+     * @param Expiration|null $expiration
53
+     */
54
+    public function __construct(IUserManager $userManager = null,
55
+                                Expiration $expiration = null) {
56
+        parent::__construct();
57 57
 
58
-		$this->userManager = $userManager;
59
-		$this->expiration = $expiration;
60
-	}
58
+        $this->userManager = $userManager;
59
+        $this->expiration = $expiration;
60
+    }
61 61
 
62
-	protected function configure() {
63
-		$this
64
-			->setName('trashbin:expire')
65
-			->setDescription('Expires the users trashbin')
66
-			->addArgument(
67
-				'user_id',
68
-				InputArgument::OPTIONAL | InputArgument::IS_ARRAY,
69
-				'expires the trashbin of the given user(s), if no user is given the trash for all users will be expired'
70
-			);
71
-	}
62
+    protected function configure() {
63
+        $this
64
+            ->setName('trashbin:expire')
65
+            ->setDescription('Expires the users trashbin')
66
+            ->addArgument(
67
+                'user_id',
68
+                InputArgument::OPTIONAL | InputArgument::IS_ARRAY,
69
+                'expires the trashbin of the given user(s), if no user is given the trash for all users will be expired'
70
+            );
71
+    }
72 72
 
73
-	protected function execute(InputInterface $input, OutputInterface $output) {
74
-		$maxAge = $this->expiration->getMaxAgeAsTimestamp();
75
-		if (!$maxAge) {
76
-			$output->writeln("No expiry configured.");
77
-			return;
78
-		}
73
+    protected function execute(InputInterface $input, OutputInterface $output) {
74
+        $maxAge = $this->expiration->getMaxAgeAsTimestamp();
75
+        if (!$maxAge) {
76
+            $output->writeln("No expiry configured.");
77
+            return;
78
+        }
79 79
 
80
-		$users = $input->getArgument('user_id');
81
-		if (!empty($users)) {
82
-			foreach ($users as $user) {
83
-				if ($this->userManager->userExists($user)) {
84
-					$output->writeln("Remove deleted files of   <info>$user</info>");
85
-					$userObject = $this->userManager->get($user);
86
-					$this->expireTrashForUser($userObject);
87
-				} else {
88
-					$output->writeln("<error>Unknown user $user</error>");
89
-				}
90
-			}
91
-		} else {
92
-			$p = new ProgressBar($output);
93
-			$p->start();
94
-			$this->userManager->callForSeenUsers(function (IUser $user) use ($p) {
95
-				$p->advance();
96
-				$this->expireTrashForUser($user);
97
-			});
98
-			$p->finish();
99
-			$output->writeln('');
100
-		}
101
-	}
80
+        $users = $input->getArgument('user_id');
81
+        if (!empty($users)) {
82
+            foreach ($users as $user) {
83
+                if ($this->userManager->userExists($user)) {
84
+                    $output->writeln("Remove deleted files of   <info>$user</info>");
85
+                    $userObject = $this->userManager->get($user);
86
+                    $this->expireTrashForUser($userObject);
87
+                } else {
88
+                    $output->writeln("<error>Unknown user $user</error>");
89
+                }
90
+            }
91
+        } else {
92
+            $p = new ProgressBar($output);
93
+            $p->start();
94
+            $this->userManager->callForSeenUsers(function (IUser $user) use ($p) {
95
+                $p->advance();
96
+                $this->expireTrashForUser($user);
97
+            });
98
+            $p->finish();
99
+            $output->writeln('');
100
+        }
101
+    }
102 102
 
103
-	public function expireTrashForUser(IUser $user) {
104
-		$uid = $user->getUID();
105
-		if (!$this->setupFS($uid)) {
106
-			return;
107
-		}
108
-		$dirContent = Helper::getTrashFiles('/', $uid, 'mtime');
109
-		Trashbin::deleteExpiredFiles($dirContent, $uid);
110
-	}
103
+    public function expireTrashForUser(IUser $user) {
104
+        $uid = $user->getUID();
105
+        if (!$this->setupFS($uid)) {
106
+            return;
107
+        }
108
+        $dirContent = Helper::getTrashFiles('/', $uid, 'mtime');
109
+        Trashbin::deleteExpiredFiles($dirContent, $uid);
110
+    }
111 111
 
112
-	/**
113
-	 * Act on behalf on trash item owner
114
-	 * @param string $user
115
-	 * @return boolean
116
-	 */
117
-	protected function setupFS($user) {
118
-		\OC_Util::tearDownFS();
119
-		\OC_Util::setupFS($user);
112
+    /**
113
+     * Act on behalf on trash item owner
114
+     * @param string $user
115
+     * @return boolean
116
+     */
117
+    protected function setupFS($user) {
118
+        \OC_Util::tearDownFS();
119
+        \OC_Util::setupFS($user);
120 120
 
121
-		// Check if this user has a trashbin directory
122
-		$view = new \OC\Files\View('/' . $user);
123
-		if (!$view->is_dir('/files_trashbin/files')) {
124
-			return false;
125
-		}
121
+        // Check if this user has a trashbin directory
122
+        $view = new \OC\Files\View('/' . $user);
123
+        if (!$view->is_dir('/files_trashbin/files')) {
124
+            return false;
125
+        }
126 126
 
127
-		return true;
128
-	}
127
+        return true;
128
+    }
129 129
 }
Please login to merge, or discard this patch.
apps/files_trashbin/lib/BackgroundJob/ExpireTrash.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
 			return;
79 79
 		}
80 80
 
81
-		$this->userManager->callForSeenUsers(function (IUser $user) {
81
+		$this->userManager->callForSeenUsers(function(IUser $user) {
82 82
 			$uid = $user->getUID();
83 83
 			if (!$this->setupFS($uid)) {
84 84
 				return;
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
 		\OC_Util::setupFS($user);
101 101
 
102 102
 		// Check if this user has a trashbin directory
103
-		$view = new \OC\Files\View('/' . $user);
103
+		$view = new \OC\Files\View('/'.$user);
104 104
 		if (!$view->is_dir('/files_trashbin/files')) {
105 105
 			return false;
106 106
 		}
Please login to merge, or discard this patch.
Indentation   +63 added lines, -63 removed lines patch added patch discarded remove patch
@@ -36,77 +36,77 @@
 block discarded – undo
36 36
 
37 37
 class ExpireTrash extends \OC\BackgroundJob\TimedJob {
38 38
 
39
-	/**
40
-	 * @var Expiration
41
-	 */
42
-	private $expiration;
39
+    /**
40
+     * @var Expiration
41
+     */
42
+    private $expiration;
43 43
 	
44
-	/**
45
-	 * @var IUserManager
46
-	 */
47
-	private $userManager;
44
+    /**
45
+     * @var IUserManager
46
+     */
47
+    private $userManager;
48 48
 
49
-	/**
50
-	 * @param IUserManager|null $userManager
51
-	 * @param Expiration|null $expiration
52
-	 */
53
-	public function __construct(IUserManager $userManager = null,
54
-								Expiration $expiration = null) {
55
-		// Run once per 30 minutes
56
-		$this->setInterval(60 * 30);
49
+    /**
50
+     * @param IUserManager|null $userManager
51
+     * @param Expiration|null $expiration
52
+     */
53
+    public function __construct(IUserManager $userManager = null,
54
+                                Expiration $expiration = null) {
55
+        // Run once per 30 minutes
56
+        $this->setInterval(60 * 30);
57 57
 
58
-		if (is_null($expiration) || is_null($userManager)) {
59
-			$this->fixDIForJobs();
60
-		} else {
61
-			$this->userManager = $userManager;
62
-			$this->expiration = $expiration;
63
-		}
64
-	}
58
+        if (is_null($expiration) || is_null($userManager)) {
59
+            $this->fixDIForJobs();
60
+        } else {
61
+            $this->userManager = $userManager;
62
+            $this->expiration = $expiration;
63
+        }
64
+    }
65 65
 
66
-	protected function fixDIForJobs() {
67
-		/** @var Application $application */
68
-		$application = \OC::$server->query(Application::class);
69
-		$this->userManager = \OC::$server->getUserManager();
70
-		$this->expiration = $application->getContainer()->query('Expiration');
71
-	}
66
+    protected function fixDIForJobs() {
67
+        /** @var Application $application */
68
+        $application = \OC::$server->query(Application::class);
69
+        $this->userManager = \OC::$server->getUserManager();
70
+        $this->expiration = $application->getContainer()->query('Expiration');
71
+    }
72 72
 
73
-	/**
74
-	 * @param $argument
75
-	 * @throws \Exception
76
-	 */
77
-	protected function run($argument) {
78
-		$maxAge = $this->expiration->getMaxAgeAsTimestamp();
79
-		if (!$maxAge) {
80
-			return;
81
-		}
73
+    /**
74
+     * @param $argument
75
+     * @throws \Exception
76
+     */
77
+    protected function run($argument) {
78
+        $maxAge = $this->expiration->getMaxAgeAsTimestamp();
79
+        if (!$maxAge) {
80
+            return;
81
+        }
82 82
 
83
-		$this->userManager->callForSeenUsers(function (IUser $user) {
84
-			$uid = $user->getUID();
85
-			if (!$this->setupFS($uid)) {
86
-				return;
87
-			}
88
-			$dirContent = Helper::getTrashFiles('/', $uid, 'mtime');
89
-			Trashbin::deleteExpiredFiles($dirContent, $uid);
90
-		});
83
+        $this->userManager->callForSeenUsers(function (IUser $user) {
84
+            $uid = $user->getUID();
85
+            if (!$this->setupFS($uid)) {
86
+                return;
87
+            }
88
+            $dirContent = Helper::getTrashFiles('/', $uid, 'mtime');
89
+            Trashbin::deleteExpiredFiles($dirContent, $uid);
90
+        });
91 91
 		
92
-		\OC_Util::tearDownFS();
93
-	}
92
+        \OC_Util::tearDownFS();
93
+    }
94 94
 
95
-	/**
96
-	 * Act on behalf on trash item owner
97
-	 * @param string $user
98
-	 * @return boolean
99
-	 */
100
-	protected function setupFS($user) {
101
-		\OC_Util::tearDownFS();
102
-		\OC_Util::setupFS($user);
95
+    /**
96
+     * Act on behalf on trash item owner
97
+     * @param string $user
98
+     * @return boolean
99
+     */
100
+    protected function setupFS($user) {
101
+        \OC_Util::tearDownFS();
102
+        \OC_Util::setupFS($user);
103 103
 
104
-		// Check if this user has a trashbin directory
105
-		$view = new \OC\Files\View('/' . $user);
106
-		if (!$view->is_dir('/files_trashbin/files')) {
107
-			return false;
108
-		}
104
+        // Check if this user has a trashbin directory
105
+        $view = new \OC\Files\View('/' . $user);
106
+        if (!$view->is_dir('/files_trashbin/files')) {
107
+            return false;
108
+        }
109 109
 
110
-		return true;
111
-	}
110
+        return true;
111
+    }
112 112
 }
Please login to merge, or discard this patch.
apps/comments/lib/Notification/Listener.php 2 patches
Indentation   +77 added lines, -77 removed lines patch added patch discarded remove patch
@@ -27,91 +27,91 @@
 block discarded – undo
27 27
 use OCP\Notification\IManager;
28 28
 
29 29
 class Listener {
30
-	/** @var IManager */
31
-	protected $notificationManager;
30
+    /** @var IManager */
31
+    protected $notificationManager;
32 32
 
33
-	/** @var IUserManager */
34
-	protected $userManager;
33
+    /** @var IUserManager */
34
+    protected $userManager;
35 35
 
36
-	/**
37
-	 * Listener constructor.
38
-	 *
39
-	 * @param IManager $notificationManager
40
-	 * @param IUserManager $userManager
41
-	 */
42
-	public function __construct(
43
-		IManager $notificationManager,
44
-		IUserManager $userManager
45
-	) {
46
-		$this->notificationManager = $notificationManager;
47
-		$this->userManager = $userManager;
48
-	}
36
+    /**
37
+     * Listener constructor.
38
+     *
39
+     * @param IManager $notificationManager
40
+     * @param IUserManager $userManager
41
+     */
42
+    public function __construct(
43
+        IManager $notificationManager,
44
+        IUserManager $userManager
45
+    ) {
46
+        $this->notificationManager = $notificationManager;
47
+        $this->userManager = $userManager;
48
+    }
49 49
 
50
-	/**
51
-	 * @param CommentsEvent $event
52
-	 */
53
-	public function evaluate(CommentsEvent $event) {
54
-		$comment = $event->getComment();
50
+    /**
51
+     * @param CommentsEvent $event
52
+     */
53
+    public function evaluate(CommentsEvent $event) {
54
+        $comment = $event->getComment();
55 55
 
56
-		$mentions = $this->extractMentions($comment->getMentions());
57
-		if (empty($mentions)) {
58
-			// no one to notify
59
-			return;
60
-		}
56
+        $mentions = $this->extractMentions($comment->getMentions());
57
+        if (empty($mentions)) {
58
+            // no one to notify
59
+            return;
60
+        }
61 61
 
62
-		$notification = $this->instantiateNotification($comment);
62
+        $notification = $this->instantiateNotification($comment);
63 63
 
64
-		foreach ($mentions as $uid) {
65
-			if (($comment->getActorType() === 'users' && $uid === $comment->getActorId())
66
-				|| !$this->userManager->userExists($uid)
67
-			) {
68
-				// do not notify unknown users or yourself
69
-				continue;
70
-			}
64
+        foreach ($mentions as $uid) {
65
+            if (($comment->getActorType() === 'users' && $uid === $comment->getActorId())
66
+                || !$this->userManager->userExists($uid)
67
+            ) {
68
+                // do not notify unknown users or yourself
69
+                continue;
70
+            }
71 71
 
72
-			$notification->setUser($uid);
73
-			if ($event->getEvent() === CommentsEvent::EVENT_DELETE
74
-				|| $event->getEvent() === CommentsEvent::EVENT_PRE_UPDATE) {
75
-				$this->notificationManager->markProcessed($notification);
76
-			} else {
77
-				$this->notificationManager->notify($notification);
78
-			}
79
-		}
80
-	}
72
+            $notification->setUser($uid);
73
+            if ($event->getEvent() === CommentsEvent::EVENT_DELETE
74
+                || $event->getEvent() === CommentsEvent::EVENT_PRE_UPDATE) {
75
+                $this->notificationManager->markProcessed($notification);
76
+            } else {
77
+                $this->notificationManager->notify($notification);
78
+            }
79
+        }
80
+    }
81 81
 
82
-	/**
83
-	 * creates a notification instance and fills it with comment data
84
-	 *
85
-	 * @param IComment $comment
86
-	 * @return \OCP\Notification\INotification
87
-	 */
88
-	public function instantiateNotification(IComment $comment) {
89
-		$notification = $this->notificationManager->createNotification();
90
-		$notification
91
-			->setApp('comments')
92
-			->setObject('comment', $comment->getId())
93
-			->setSubject('mention', [ $comment->getObjectType(), $comment->getObjectId() ])
94
-			->setDateTime($comment->getCreationDateTime());
82
+    /**
83
+     * creates a notification instance and fills it with comment data
84
+     *
85
+     * @param IComment $comment
86
+     * @return \OCP\Notification\INotification
87
+     */
88
+    public function instantiateNotification(IComment $comment) {
89
+        $notification = $this->notificationManager->createNotification();
90
+        $notification
91
+            ->setApp('comments')
92
+            ->setObject('comment', $comment->getId())
93
+            ->setSubject('mention', [ $comment->getObjectType(), $comment->getObjectId() ])
94
+            ->setDateTime($comment->getCreationDateTime());
95 95
 
96
-		return $notification;
97
-	}
96
+        return $notification;
97
+    }
98 98
 
99
-	/**
100
-	 * flattens the mention array returned from comments to a list of user ids.
101
-	 *
102
-	 * @param array $mentions
103
-	 * @return string[] containing the mentions, e.g. ['alice', 'bob']
104
-	 */
105
-	public function extractMentions(array $mentions) {
106
-		if (empty($mentions)) {
107
-			return [];
108
-		}
109
-		$uids = [];
110
-		foreach ($mentions as $mention) {
111
-			if ($mention['type'] === 'user') {
112
-				$uids[] = $mention['id'];
113
-			}
114
-		}
115
-		return $uids;
116
-	}
99
+    /**
100
+     * flattens the mention array returned from comments to a list of user ids.
101
+     *
102
+     * @param array $mentions
103
+     * @return string[] containing the mentions, e.g. ['alice', 'bob']
104
+     */
105
+    public function extractMentions(array $mentions) {
106
+        if (empty($mentions)) {
107
+            return [];
108
+        }
109
+        $uids = [];
110
+        foreach ($mentions as $mention) {
111
+            if ($mention['type'] === 'user') {
112
+                $uids[] = $mention['id'];
113
+            }
114
+        }
115
+        return $uids;
116
+    }
117 117
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -90,7 +90,7 @@
 block discarded – undo
90 90
 		$notification
91 91
 			->setApp('comments')
92 92
 			->setObject('comment', $comment->getId())
93
-			->setSubject('mention', [ $comment->getObjectType(), $comment->getObjectId() ])
93
+			->setSubject('mention', [$comment->getObjectType(), $comment->getObjectId()])
94 94
 			->setDateTime($comment->getCreationDateTime());
95 95
 
96 96
 		return $notification;
Please login to merge, or discard this patch.
apps/user_ldap/lib/Command/CreateEmptyConfig.php 2 patches
Indentation   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -33,39 +33,39 @@
 block discarded – undo
33 33
 use Symfony\Component\Console\Output\OutputInterface;
34 34
 
35 35
 class CreateEmptyConfig extends Command {
36
-	/** @var \OCA\User_LDAP\Helper */
37
-	protected $helper;
36
+    /** @var \OCA\User_LDAP\Helper */
37
+    protected $helper;
38 38
 
39
-	/**
40
-	 * @param Helper $helper
41
-	 */
42
-	public function __construct(Helper $helper) {
43
-		$this->helper = $helper;
44
-		parent::__construct();
45
-	}
39
+    /**
40
+     * @param Helper $helper
41
+     */
42
+    public function __construct(Helper $helper) {
43
+        $this->helper = $helper;
44
+        parent::__construct();
45
+    }
46 46
 
47
-	protected function configure() {
48
-		$this
49
-			->setName('ldap:create-empty-config')
50
-			->setDescription('creates an empty LDAP configuration')
51
-			->addOption(
52
-				'only-print-prefix',
53
-				'p',
54
-				InputOption::VALUE_NONE,
55
-				'outputs only the prefix'
56
-			)
57
-		;
58
-	}
47
+    protected function configure() {
48
+        $this
49
+            ->setName('ldap:create-empty-config')
50
+            ->setDescription('creates an empty LDAP configuration')
51
+            ->addOption(
52
+                'only-print-prefix',
53
+                'p',
54
+                InputOption::VALUE_NONE,
55
+                'outputs only the prefix'
56
+            )
57
+        ;
58
+    }
59 59
 
60
-	protected function execute(InputInterface $input, OutputInterface $output) {
61
-		$configPrefix = $this->helper->getNextServerConfigurationPrefix();
62
-		$configHolder = new Configuration($configPrefix);
63
-		$configHolder->saveConfiguration();
60
+    protected function execute(InputInterface $input, OutputInterface $output) {
61
+        $configPrefix = $this->helper->getNextServerConfigurationPrefix();
62
+        $configHolder = new Configuration($configPrefix);
63
+        $configHolder->saveConfiguration();
64 64
 
65
-		$prose = '';
66
-		if (!$input->getOption('only-print-prefix')) {
67
-			$prose = 'Created new configuration with configID ';
68
-		}
69
-		$output->writeln($prose . "{$configPrefix}");
70
-	}
65
+        $prose = '';
66
+        if (!$input->getOption('only-print-prefix')) {
67
+            $prose = 'Created new configuration with configID ';
68
+        }
69
+        $output->writeln($prose . "{$configPrefix}");
70
+    }
71 71
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -66,6 +66,6 @@
 block discarded – undo
66 66
 		if (!$input->getOption('only-print-prefix')) {
67 67
 			$prose = 'Created new configuration with configID ';
68 68
 		}
69
-		$output->writeln($prose . "{$configPrefix}");
69
+		$output->writeln($prose."{$configPrefix}");
70 70
 	}
71 71
 }
Please login to merge, or discard this patch.