Passed
Push — master ( 67432a...b0c204 )
by Roeland
10:32 queued 10s
created
lib/private/AppFramework/App.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -57,10 +57,10 @@  discard block
 block discarded – undo
57 57
 	 * the transformed app id, defaults to OCA\
58 58
 	 * @return string the starting namespace for the app
59 59
 	 */
60
-	public static function buildAppNamespace(string $appId, string $topNamespace='OCA\\'): string {
60
+	public static function buildAppNamespace(string $appId, string $topNamespace = 'OCA\\'): string {
61 61
 		// Hit the cache!
62 62
 		if (isset(self::$nameSpaceCache[$appId])) {
63
-			return $topNamespace . self::$nameSpaceCache[$appId];
63
+			return $topNamespace.self::$nameSpaceCache[$appId];
64 64
 		}
65 65
 
66 66
 		$appInfo = \OC_App::getAppInfo($appId);
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
 			self::$nameSpaceCache[$appId] = ucfirst($appId);
72 72
 		}
73 73
 
74
-		return $topNamespace . self::$nameSpaceCache[$appId];
74
+		return $topNamespace.self::$nameSpaceCache[$appId];
75 75
 	}
76 76
 
77 77
 
@@ -95,11 +95,11 @@  discard block
 block discarded – undo
95 95
 		// first try $controllerName then go for \OCA\AppName\Controller\$controllerName
96 96
 		try {
97 97
 			$controller = $container->query($controllerName);
98
-		} catch(QueryException $e) {
98
+		} catch (QueryException $e) {
99 99
 			if (strpos($controllerName, '\\Controller\\') !== false) {
100 100
 				// This is from a global registered app route that is not enabled.
101 101
 				[/*OC(A)*/, $app, /* Controller/Name*/] = explode('\\', $controllerName, 3);
102
-				throw new HintException('App ' . strtolower($app) . ' is not enabled');
102
+				throw new HintException('App '.strtolower($app).' is not enabled');
103 103
 			}
104 104
 
105 105
 			if ($appName === 'core') {
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
 			} else {
110 110
 				$appNameSpace = self::buildAppNamespace($appName);
111 111
 			}
112
-			$controllerName = $appNameSpace . '\\Controller\\' . $controllerName;
112
+			$controllerName = $appNameSpace.'\\Controller\\'.$controllerName;
113 113
 			$controller = $container->query($controllerName);
114 114
 		}
115 115
 
@@ -127,17 +127,17 @@  discard block
 block discarded – undo
127 127
 
128 128
 		$io = $container[IOutput::class];
129 129
 
130
-		if(!is_null($httpHeaders)) {
130
+		if (!is_null($httpHeaders)) {
131 131
 			$io->setHeader($httpHeaders);
132 132
 		}
133 133
 
134
-		foreach($responseHeaders as $name => $value) {
135
-			$io->setHeader($name . ': ' . $value);
134
+		foreach ($responseHeaders as $name => $value) {
135
+			$io->setHeader($name.': '.$value);
136 136
 		}
137 137
 
138
-		foreach($responseCookies as $name => $value) {
138
+		foreach ($responseCookies as $name => $value) {
139 139
 			$expireDate = null;
140
-			if($value['expireDate'] instanceof \DateTime) {
140
+			if ($value['expireDate'] instanceof \DateTime) {
141 141
 				$expireDate = $value['expireDate']->getTimestamp();
142 142
 			}
143 143
 			$io->setCookie(
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
 		 */
160 160
 		$emptyResponse = false;
161 161
 		if (preg_match('/^HTTP\/\d\.\d (\d{3}) .*$/', $httpHeaders, $matches)) {
162
-			$status = (int)$matches[1];
162
+			$status = (int) $matches[1];
163 163
 			if ($status === Http::STATUS_NO_CONTENT || $status === Http::STATUS_NOT_MODIFIED) {
164 164
 				$emptyResponse = true;
165 165
 			}
@@ -169,7 +169,7 @@  discard block
 block discarded – undo
169 169
 			if ($response instanceof ICallbackResponse) {
170 170
 				$response->callback($io);
171 171
 			} else if (!is_null($output)) {
172
-				$io->setHeader('Content-Length: ' . strlen($output));
172
+				$io->setHeader('Content-Length: '.strlen($output));
173 173
 				$io->setOutput($output);
174 174
 			}
175 175
 		}
@@ -189,14 +189,14 @@  discard block
 block discarded – undo
189 189
 	 * @param DIContainer $container an instance of a pimple container.
190 190
 	 */
191 191
 	public static function part(string $controllerName, string $methodName, array $urlParams,
192
-								DIContainer $container){
192
+								DIContainer $container) {
193 193
 
194 194
 		$container['urlParams'] = $urlParams;
195 195
 		$controller = $container[$controllerName];
196 196
 
197 197
 		$dispatcher = $container['Dispatcher'];
198 198
 
199
-		list(, , $output) =  $dispatcher->dispatch($controller, $methodName);
199
+		list(,, $output) = $dispatcher->dispatch($controller, $methodName);
200 200
 		return $output;
201 201
 	}
202 202
 
Please login to merge, or discard this patch.