Passed
Push — master ( 820e13...09d56e )
by Joas
12:51 queued 14s
created
lib/private/Federation/CloudIdManager.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -80,7 +80,7 @@
 block discarded – undo
80 80
 	 */
81 81
 	public function getCloudId(string $user, string $remote): ICloudId {
82 82
 		// TODO check what the correct url is for remote (asking the remote)
83
-		return new CloudId($user. '@' . $remote, $user, $remote);
83
+		return new CloudId($user.'@'.$remote, $user, $remote);
84 84
 	}
85 85
 
86 86
 	/**
Please login to merge, or discard this patch.
lib/private/AppFramework/Middleware/MiddlewareDispatcher.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
 	/**
54 54
 	 * Constructor
55 55
 	 */
56
-	public function __construct(){
56
+	public function __construct() {
57 57
 		$this->middlewares = [];
58 58
 		$this->middlewareCounter = 0;
59 59
 	}
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
 	 * Adds a new middleware
64 64
 	 * @param Middleware $middleWare the middleware which will be added
65 65
 	 */
66
-	public function registerMiddleware(Middleware $middleWare){
66
+	public function registerMiddleware(Middleware $middleWare) {
67 67
 		$this->middlewares[] = $middleWare;
68 68
 	}
69 69
 
@@ -85,11 +85,11 @@  discard block
 block discarded – undo
85 85
 	 * @param string $methodName the name of the method that will be called on
86 86
 	 *                           the controller
87 87
 	 */
88
-	public function beforeController(Controller $controller, string $methodName){
88
+	public function beforeController(Controller $controller, string $methodName) {
89 89
 		// we need to count so that we know which middlewares we have to ask in
90 90
 		// case there is an exception
91 91
 		$middlewareCount = \count($this->middlewares);
92
-		for($i = 0; $i < $middlewareCount; $i++){
92
+		for ($i = 0; $i < $middlewareCount; $i++) {
93 93
 			$this->middlewareCounter++;
94 94
 			$middleware = $this->middlewares[$i];
95 95
 			$middleware->beforeController($controller, $methodName);
@@ -113,11 +113,11 @@  discard block
 block discarded – undo
113 113
 	 * @throws \Exception the passed in exception if it can't handle it
114 114
 	 */
115 115
 	public function afterException(Controller $controller, string $methodName, \Exception $exception): Response {
116
-		for($i=$this->middlewareCounter-1; $i>=0; $i--){
116
+		for ($i = $this->middlewareCounter - 1; $i >= 0; $i--) {
117 117
 			$middleware = $this->middlewares[$i];
118 118
 			try {
119 119
 				return $middleware->afterException($controller, $methodName, $exception);
120
-			} catch(\Exception $exception){
120
+			} catch (\Exception $exception) {
121 121
 				continue;
122 122
 			}
123 123
 		}
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
 	 * @return Response a Response object
137 137
 	 */
138 138
 	public function afterController(Controller $controller, string $methodName, Response $response): Response {
139
-		for($i= \count($this->middlewares)-1; $i>=0; $i--){
139
+		for ($i = \count($this->middlewares) - 1; $i >= 0; $i--) {
140 140
 			$middleware = $this->middlewares[$i];
141 141
 			$response = $middleware->afterController($controller, $methodName, $response);
142 142
 		}
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
 	 * @return string the output that should be printed
156 156
 	 */
157 157
 	public function beforeOutput(Controller $controller, string $methodName, string $output): string {
158
-		for($i= \count($this->middlewares)-1; $i>=0; $i--){
158
+		for ($i = \count($this->middlewares) - 1; $i >= 0; $i--) {
159 159
 			$middleware = $this->middlewares[$i];
160 160
 			$output = $middleware->beforeOutput($controller, $methodName, $output);
161 161
 		}
Please login to merge, or discard this patch.
lib/private/AppFramework/Utility/ControllerMethodReflector.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
 	 * @param object $object an object or classname
44 44
 	 * @param string $method the method which we want to inspect
45 45
 	 */
46
-	public function reflect($object, string $method){
46
+	public function reflect($object, string $method) {
47 47
 		$reflection = new \ReflectionMethod($object, $method);
48 48
 		$docs = $reflection->getDocComment();
49 49
 
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
 			}
83 83
 
84 84
 			$default = null;
85
-			if($param->isOptional()) {
85
+			if ($param->isOptional()) {
86 86
 				$default = $param->getDefaultValue();
87 87
 			}
88 88
 			$this->parameters[$param->name] = $default;
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
 	 * would return int or null if not existing
98 98
 	 */
99 99
 	public function getType(string $parameter) {
100
-		if(array_key_exists($parameter, $this->types)) {
100
+		if (array_key_exists($parameter, $this->types)) {
101 101
 			return $this->types[$parameter];
102 102
 		}
103 103
 
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
 	 * @return string
129 129
 	 */
130 130
 	public function getAnnotationParameter(string $name, string $key): string {
131
-		if(isset($this->annotations[$name][$key])) {
131
+		if (isset($this->annotations[$name][$key])) {
132 132
 			return $this->annotations[$name][$key];
133 133
 		}
134 134
 
Please login to merge, or discard this patch.
lib/private/OCS/DiscoveryService.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
 	public function discover(string $remote, string $service, bool $skipCache = false): array {
66 66
 		// Check the cache first
67 67
 		if ($skipCache === false) {
68
-			$cacheData = $this->cache->get($remote . '#' . $service);
68
+			$cacheData = $this->cache->get($remote.'#'.$service);
69 69
 			if ($cacheData) {
70 70
 				$data = json_decode($cacheData, true);
71 71
 				if (\is_array($data)) {
@@ -78,11 +78,11 @@  discard block
 block discarded – undo
78 78
 
79 79
 		// query the remote server for available services
80 80
 		try {
81
-			$response = $this->client->get($remote . '/ocs-provider/', [
81
+			$response = $this->client->get($remote.'/ocs-provider/', [
82 82
 				'timeout' => 10,
83 83
 				'connect_timeout' => 10,
84 84
 			]);
85
-			if($response->getStatusCode() === Http::STATUS_OK) {
85
+			if ($response->getStatusCode() === Http::STATUS_OK) {
86 86
 				$decodedServices = json_decode($response->getBody(), true);
87 87
 				if (\is_array($decodedServices)) {
88 88
 					$discoveredServices = $this->getEndpoints($decodedServices, $service);
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
 		}
94 94
 
95 95
 		// Write into cache
96
-		$this->cache->set($remote . '#' . $service, json_encode($discoveredServices), 60*60*24);
96
+		$this->cache->set($remote.'#'.$service, json_encode($discoveredServices), 60 * 60 * 24);
97 97
 		return $discoveredServices;
98 98
 	}
99 99
 
@@ -108,9 +108,9 @@  discard block
 block discarded – undo
108 108
 
109 109
 		$discoveredServices = [];
110 110
 
111
-		if(isset($decodedServices['services'][$service]['endpoints'])) {
111
+		if (isset($decodedServices['services'][$service]['endpoints'])) {
112 112
 			foreach ($decodedServices['services'][$service]['endpoints'] as $endpoint => $url) {
113
-				if($this->isSafeUrl($url)) {
113
+				if ($this->isSafeUrl($url)) {
114 114
 					$discoveredServices[$endpoint] = $url;
115 115
 				}
116 116
 			}
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
 	 * @return bool
128 128
 	 */
129 129
 	protected function isSafeUrl(string $url): bool {
130
-		return (bool)preg_match('/^[\/\.\-A-Za-z0-9]+$/', $url);
130
+		return (bool) preg_match('/^[\/\.\-A-Za-z0-9]+$/', $url);
131 131
 	}
132 132
 
133 133
 }
Please login to merge, or discard this patch.
lib/private/IntegrityCheck/Helpers/FileAccessHelper.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -61,8 +61,8 @@  discard block
 block discarded – undo
61 61
 	 */
62 62
 	public function file_put_contents(string $filename, string $data): int {
63 63
 		$bytesWritten = @file_put_contents($filename, $data);
64
-		if ($bytesWritten === false || $bytesWritten !== \strlen($data)){
65
-			throw new \Exception('Failed to write into ' . $filename);
64
+		if ($bytesWritten === false || $bytesWritten !== \strlen($data)) {
65
+			throw new \Exception('Failed to write into '.$filename);
66 66
 		}
67 67
 		return $bytesWritten;
68 68
 	}
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
 	 */
82 82
 	public function assertDirectoryExists(string $path) {
83 83
 		if (!is_dir($path)) {
84
-			throw new \Exception('Directory ' . $path . ' does not exist.');
84
+			throw new \Exception('Directory '.$path.' does not exist.');
85 85
 		}
86 86
 	}
87 87
 }
Please login to merge, or discard this patch.
lib/private/IntegrityCheck/Helpers/AppLocator.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@
 block discarded – undo
40 40
 	 */
41 41
 	public function getAppPath(string $appId): string {
42 42
 		$path = \OC_App::getAppPath($appId);
43
-		if($path === false) {
43
+		if ($path === false) {
44 44
 
45 45
 			throw new \Exception('App not found');
46 46
 		}
Please login to merge, or discard this patch.
lib/private/L10N/L10N.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -163,7 +163,7 @@
 block discarded – undo
163 163
 			$data = strtotime($data);
164 164
 			$value->setTimestamp($data);
165 165
 		} else if ($data !== null) {
166
-			$data = (int)$data;
166
+			$data = (int) $data;
167 167
 			$value->setTimestamp($data);
168 168
 		}
169 169
 
Please login to merge, or discard this patch.
lib/private/SystemTag/SystemTagManager.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -139,14 +139,14 @@  discard block
 block discarded – undo
139 139
 			->from(self::TAG_TABLE);
140 140
 
141 141
 		if (!\is_null($visibilityFilter)) {
142
-			$query->andWhere($query->expr()->eq('visibility', $query->createNamedParameter((int)$visibilityFilter)));
142
+			$query->andWhere($query->expr()->eq('visibility', $query->createNamedParameter((int) $visibilityFilter)));
143 143
 		}
144 144
 
145 145
 		if (!empty($nameSearchPattern)) {
146 146
 			$query->andWhere(
147 147
 				$query->expr()->like(
148 148
 					'name',
149
-					$query->createNamedParameter('%' . $this->connection->escapeLikeParameter($nameSearchPattern). '%')
149
+					$query->createNamedParameter('%'.$this->connection->escapeLikeParameter($nameSearchPattern).'%')
150 150
 				)
151 151
 			);
152 152
 		}
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
180 180
 		$result->closeCursor();
181 181
 		if (!$row) {
182 182
 			throw new TagNotFoundException(
183
-				'Tag ("' . $tagName . '", '. $userVisible . ', ' . $userAssignable . ') does not exist'
183
+				'Tag ("'.$tagName.'", '.$userVisible.', '.$userAssignable.') does not exist'
184 184
 			);
185 185
 		}
186 186
 
@@ -203,7 +203,7 @@  discard block
 block discarded – undo
203 203
 			$query->execute();
204 204
 		} catch (UniqueConstraintViolationException $e) {
205 205
 			throw new TagAlreadyExistsException(
206
-				'Tag ("' . $tagName . '", '. $userVisible . ', ' . $userAssignable . ') already exists',
206
+				'Tag ("'.$tagName.'", '.$userVisible.', '.$userAssignable.') already exists',
207 207
 				0,
208 208
 				$e
209 209
 			);
@@ -212,7 +212,7 @@  discard block
 block discarded – undo
212 212
 		$tagId = $query->getLastInsertId();
213 213
 
214 214
 		$tag = new SystemTag(
215
-			(string)$tagId,
215
+			(string) $tagId,
216 216
 			$tagName,
217 217
 			$userVisible,
218 218
 			$userAssignable
@@ -264,7 +264,7 @@  discard block
 block discarded – undo
264 264
 			}
265 265
 		} catch (UniqueConstraintViolationException $e) {
266 266
 			throw new TagAlreadyExistsException(
267
-				'Tag ("' . $tagName . '", '. $userVisible . ', ' . $userAssignable . ') already exists',
267
+				'Tag ("'.$tagName.'", '.$userVisible.', '.$userAssignable.') already exists',
268 268
 				0,
269 269
 				$e
270 270
 			);
@@ -371,7 +371,7 @@  discard block
 block discarded – undo
371 371
 	}
372 372
 
373 373
 	private function createSystemTagFromRow($row) {
374
-		return new SystemTag((string)$row['id'], $row['name'], (bool)$row['visibility'], (bool)$row['editable']);
374
+		return new SystemTag((string) $row['id'], $row['name'], (bool) $row['visibility'], (bool) $row['editable']);
375 375
 	}
376 376
 
377 377
 	/**
Please login to merge, or discard this patch.
lib/private/SystemTag/SystemTagObjectMapper.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -233,7 +233,7 @@
 block discarded – undo
233 233
 		$result->closeCursor();
234 234
 
235 235
 		if ($all) {
236
-			return ((int)$row[0] === \count($objIds));
236
+			return ((int) $row[0] === \count($objIds));
237 237
 		}
238 238
 
239 239
 		return (bool) $row;
Please login to merge, or discard this patch.