@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | foreach (\OC_APP::getEnabledApps() as $app) { |
100 | 100 | $appPath = \OC_App::getAppPath($app); |
101 | 101 | if ($appPath !== false) { |
102 | - $file = $appPath . '/appinfo/routes.php'; |
|
102 | + $file = $appPath.'/appinfo/routes.php'; |
|
103 | 103 | if (file_exists($file)) { |
104 | 104 | $this->routingFiles[$app] = $file; |
105 | 105 | } |
@@ -130,14 +130,14 @@ discard block |
||
130 | 130 | if (isset($this->loadedApps[$app])) { |
131 | 131 | return; |
132 | 132 | } |
133 | - $file = \OC_App::getAppPath($app) . '/appinfo/routes.php'; |
|
133 | + $file = \OC_App::getAppPath($app).'/appinfo/routes.php'; |
|
134 | 134 | if ($file !== false && file_exists($file)) { |
135 | 135 | $routingFiles = [$app => $file]; |
136 | 136 | } else { |
137 | 137 | $routingFiles = []; |
138 | 138 | } |
139 | 139 | } |
140 | - \OC::$server->getEventLogger()->start('loadroutes' . $requestedApp, 'Loading Routes'); |
|
140 | + \OC::$server->getEventLogger()->start('loadroutes'.$requestedApp, 'Loading Routes'); |
|
141 | 141 | foreach ($routingFiles as $app => $file) { |
142 | 142 | if (!isset($this->loadedApps[$app])) { |
143 | 143 | if (!\OC_App::isAppLoaded($app)) { |
@@ -161,7 +161,7 @@ discard block |
||
161 | 161 | if (!isset($this->loadedApps['core'])) { |
162 | 162 | $this->loadedApps['core'] = true; |
163 | 163 | $this->useCollection('root'); |
164 | - require_once __DIR__ . '/../../../core/routes.php'; |
|
164 | + require_once __DIR__.'/../../../core/routes.php'; |
|
165 | 165 | |
166 | 166 | // Also add the OCS collection |
167 | 167 | $collection = $this->getCollection('root.ocs'); |
@@ -173,7 +173,7 @@ discard block |
||
173 | 173 | $collection->addPrefix('/ocs'); |
174 | 174 | $this->root->addCollection($collection); |
175 | 175 | } |
176 | - \OC::$server->getEventLogger()->end('loadroutes' . $requestedApp); |
|
176 | + \OC::$server->getEventLogger()->end('loadroutes'.$requestedApp); |
|
177 | 177 | } |
178 | 178 | |
179 | 179 | /** |
@@ -244,14 +244,14 @@ discard block |
||
244 | 244 | public function match($url) { |
245 | 245 | if (substr($url, 0, 6) === '/apps/') { |
246 | 246 | // empty string / 'apps' / $app / rest of the route |
247 | - list(, , $app,) = explode('/', $url, 4); |
|
247 | + list(,, $app,) = explode('/', $url, 4); |
|
248 | 248 | |
249 | 249 | $app = \OC_App::cleanAppId($app); |
250 | 250 | \OC::$REQUESTEDAPP = $app; |
251 | 251 | $this->loadRoutes($app); |
252 | 252 | } elseif (substr($url, 0, 13) === '/ocsapp/apps/') { |
253 | 253 | // empty string / 'ocsapp' / 'apps' / $app / rest of the route |
254 | - list(, , , $app,) = explode('/', $url, 5); |
|
254 | + list(,,, $app,) = explode('/', $url, 5); |
|
255 | 255 | |
256 | 256 | $app = \OC_App::cleanAppId($app); |
257 | 257 | \OC::$REQUESTEDAPP = $app; |
@@ -277,7 +277,7 @@ discard block |
||
277 | 277 | // However, since Symfony does not allow empty route names, the route |
278 | 278 | // we need to match is '/', so we need to append the '/' here. |
279 | 279 | try { |
280 | - $parameters = $matcher->match($url . '/'); |
|
280 | + $parameters = $matcher->match($url.'/'); |
|
281 | 281 | } catch (ResourceNotFoundException $newException) { |
282 | 282 | // If we still didn't match a route, we throw the original exception |
283 | 283 | throw $e; |
@@ -407,7 +407,7 @@ discard block |
||
407 | 407 | private function getApplicationClass(string $appName) { |
408 | 408 | $appNameSpace = App::buildAppNamespace($appName); |
409 | 409 | |
410 | - $applicationClassName = $appNameSpace . '\\AppInfo\\Application'; |
|
410 | + $applicationClassName = $appNameSpace.'\\AppInfo\\Application'; |
|
411 | 411 | |
412 | 412 | if (class_exists($applicationClassName)) { |
413 | 413 | $application = \OC::$server->query($applicationClassName); |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | * OCS routes go into a different collection |
92 | 92 | */ |
93 | 93 | $oldCollection = $this->router->getCurrentCollection(); |
94 | - $this->router->useCollection($oldCollection . '.ocs'); |
|
94 | + $this->router->useCollection($oldCollection.'.ocs'); |
|
95 | 95 | |
96 | 96 | // parse ocs simple routes |
97 | 97 | $this->processOCS($this->routes); |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | $postfix = $route['postfix'] ?? ''; |
127 | 127 | $root = $this->buildRootPrefix($route, $routeNamePrefix); |
128 | 128 | |
129 | - $url = $root . '/' . ltrim($route['url'], '/'); |
|
129 | + $url = $root.'/'.ltrim($route['url'], '/'); |
|
130 | 130 | $verb = strtoupper($route['verb'] ?? 'GET'); |
131 | 131 | |
132 | 132 | $split = explode('#', $name, 2); |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | $controllerName = $this->buildControllerName($controller); |
139 | 139 | $actionName = $this->buildActionName($action); |
140 | 140 | |
141 | - $routeName = $routeNamePrefix . $this->appName . '.' . $controller . '.' . $action . $postfix; |
|
141 | + $routeName = $routeNamePrefix.$this->appName.'.'.$controller.'.'.$action.$postfix; |
|
142 | 142 | |
143 | 143 | $router = $this->router->create($routeName, $url) |
144 | 144 | ->method($verb) |
@@ -211,7 +211,7 @@ discard block |
||
211 | 211 | |
212 | 212 | // the url parameter used as id to the resource |
213 | 213 | foreach ($actions as $action) { |
214 | - $url = $root . '/' . ltrim($config['url'], '/'); |
|
214 | + $url = $root.'/'.ltrim($config['url'], '/'); |
|
215 | 215 | $method = $action['name']; |
216 | 216 | |
217 | 217 | $verb = strtoupper($action['verb'] ?? 'GET'); |
@@ -220,7 +220,7 @@ discard block |
||
220 | 220 | $url .= '/{id}'; |
221 | 221 | } |
222 | 222 | if (isset($action['url-postfix'])) { |
223 | - $url .= '/' . $action['url-postfix']; |
|
223 | + $url .= '/'.$action['url-postfix']; |
|
224 | 224 | } |
225 | 225 | |
226 | 226 | $controller = $resource; |
@@ -228,7 +228,7 @@ discard block |
||
228 | 228 | $controllerName = $this->buildControllerName($controller); |
229 | 229 | $actionName = $this->buildActionName($method); |
230 | 230 | |
231 | - $routeName = $routeNamePrefix . $this->appName . '.' . strtolower($resource) . '.' . strtolower($method); |
|
231 | + $routeName = $routeNamePrefix.$this->appName.'.'.strtolower($resource).'.'.strtolower($method); |
|
232 | 232 | |
233 | 233 | $this->router->create($routeName, $url) |
234 | 234 | ->method($verb) |
@@ -238,7 +238,7 @@ discard block |
||
238 | 238 | } |
239 | 239 | |
240 | 240 | private function buildRootPrefix(array $route, string $routeNamePrefix): string { |
241 | - $defaultRoot = $this->appName === 'core' ? '' : '/apps/' . $this->appName; |
|
241 | + $defaultRoot = $this->appName === 'core' ? '' : '/apps/'.$this->appName; |
|
242 | 242 | $root = $route['root'] ?? $defaultRoot; |
243 | 243 | |
244 | 244 | if ($routeNamePrefix !== '') { |
@@ -261,7 +261,7 @@ discard block |
||
261 | 261 | */ |
262 | 262 | private function buildControllerName(string $controller): string { |
263 | 263 | if (!isset($this->controllerNameCache[$controller])) { |
264 | - $this->controllerNameCache[$controller] = $this->underScoreToCamelCase(ucfirst($controller)) . 'Controller'; |
|
264 | + $this->controllerNameCache[$controller] = $this->underScoreToCamelCase(ucfirst($controller)).'Controller'; |
|
265 | 265 | } |
266 | 266 | return $this->controllerNameCache[$controller]; |
267 | 267 | } |
@@ -284,7 +284,7 @@ discard block |
||
284 | 284 | $pattern = '/_[a-z]?/'; |
285 | 285 | return preg_replace_callback( |
286 | 286 | $pattern, |
287 | - function ($matches) { |
|
287 | + function($matches) { |
|
288 | 288 | return strtoupper(ltrim($matches[0], '_')); |
289 | 289 | }, |
290 | 290 | $str); |