@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | * OCS routes go into a different collection |
| 93 | 93 | */ |
| 94 | 94 | $oldCollection = $this->router->getCurrentCollection(); |
| 95 | - $this->router->useCollection($oldCollection . '.ocs'); |
|
| 95 | + $this->router->useCollection($oldCollection.'.ocs'); |
|
| 96 | 96 | |
| 97 | 97 | // parse ocs simple routes |
| 98 | 98 | $this->processOCS($this->routes); |
@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | $postfix = $route['postfix'] ?? ''; |
| 128 | 128 | $root = $this->buildRootPrefix($route, $routeNamePrefix); |
| 129 | 129 | |
| 130 | - $url = $root . '/' . ltrim($route['url'], '/'); |
|
| 130 | + $url = $root.'/'.ltrim($route['url'], '/'); |
|
| 131 | 131 | $verb = strtoupper($route['verb'] ?? 'GET'); |
| 132 | 132 | |
| 133 | 133 | $split = explode('#', $name, 2); |
@@ -139,7 +139,7 @@ discard block |
||
| 139 | 139 | $controllerName = $this->buildControllerName($controller); |
| 140 | 140 | $actionName = $this->buildActionName($action); |
| 141 | 141 | |
| 142 | - $routeName = $routeNamePrefix . $this->appName . '.' . $controller . '.' . $action . $postfix; |
|
| 142 | + $routeName = $routeNamePrefix.$this->appName.'.'.$controller.'.'.$action.$postfix; |
|
| 143 | 143 | |
| 144 | 144 | // register the route |
| 145 | 145 | $handler = new RouteActionHandler($this->container, $controllerName, $actionName); |
@@ -215,7 +215,7 @@ discard block |
||
| 215 | 215 | |
| 216 | 216 | // the url parameter used as id to the resource |
| 217 | 217 | foreach ($actions as $action) { |
| 218 | - $url = $root . '/' . ltrim($config['url'], '/'); |
|
| 218 | + $url = $root.'/'.ltrim($config['url'], '/'); |
|
| 219 | 219 | $method = $action['name']; |
| 220 | 220 | |
| 221 | 221 | $verb = strtoupper($action['verb'] ?? 'GET'); |
@@ -224,7 +224,7 @@ discard block |
||
| 224 | 224 | $url .= '/{id}'; |
| 225 | 225 | } |
| 226 | 226 | if (isset($action['url-postfix'])) { |
| 227 | - $url .= '/' . $action['url-postfix']; |
|
| 227 | + $url .= '/'.$action['url-postfix']; |
|
| 228 | 228 | } |
| 229 | 229 | |
| 230 | 230 | $controller = $resource; |
@@ -232,7 +232,7 @@ discard block |
||
| 232 | 232 | $controllerName = $this->buildControllerName($controller); |
| 233 | 233 | $actionName = $this->buildActionName($method); |
| 234 | 234 | |
| 235 | - $routeName = $routeNamePrefix . $this->appName . '.' . strtolower($resource) . '.' . strtolower($method); |
|
| 235 | + $routeName = $routeNamePrefix.$this->appName.'.'.strtolower($resource).'.'.strtolower($method); |
|
| 236 | 236 | |
| 237 | 237 | $this->router->create($routeName, $url)->method($verb)->action( |
| 238 | 238 | new RouteActionHandler($this->container, $controllerName, $actionName) |
@@ -242,7 +242,7 @@ discard block |
||
| 242 | 242 | } |
| 243 | 243 | |
| 244 | 244 | private function buildRootPrefix(array $route, string $routeNamePrefix): string { |
| 245 | - $defaultRoot = $this->appName === 'core' ? '' : '/apps/' . $this->appName; |
|
| 245 | + $defaultRoot = $this->appName === 'core' ? '' : '/apps/'.$this->appName; |
|
| 246 | 246 | $root = $route['root'] ?? $defaultRoot; |
| 247 | 247 | |
| 248 | 248 | if ($routeNamePrefix !== '') { |
@@ -265,7 +265,7 @@ discard block |
||
| 265 | 265 | */ |
| 266 | 266 | private function buildControllerName(string $controller): string { |
| 267 | 267 | if (!isset($this->controllerNameCache[$controller])) { |
| 268 | - $this->controllerNameCache[$controller] = $this->underScoreToCamelCase(ucfirst($controller)) . 'Controller'; |
|
| 268 | + $this->controllerNameCache[$controller] = $this->underScoreToCamelCase(ucfirst($controller)).'Controller'; |
|
| 269 | 269 | } |
| 270 | 270 | return $this->controllerNameCache[$controller]; |
| 271 | 271 | } |
@@ -288,7 +288,7 @@ discard block |
||
| 288 | 288 | $pattern = '/_[a-z]?/'; |
| 289 | 289 | return preg_replace_callback( |
| 290 | 290 | $pattern, |
| 291 | - function ($matches) { |
|
| 291 | + function($matches) { |
|
| 292 | 292 | return strtoupper(ltrim($matches[0], '_')); |
| 293 | 293 | }, |
| 294 | 294 | $str); |
@@ -36,59 +36,59 @@ |
||
| 36 | 36 | |
| 37 | 37 | return [ |
| 38 | 38 | 'resources' => [ |
| 39 | - 'AuthSettings' => ['url' => '/settings/personal/authtokens' , 'root' => ''], |
|
| 39 | + 'AuthSettings' => ['url' => '/settings/personal/authtokens', 'root' => ''], |
|
| 40 | 40 | ], |
| 41 | 41 | 'routes' => [ |
| 42 | - ['name' => 'AuthSettings#wipe', 'url' => '/settings/personal/authtokens/wipe/{id}', 'verb' => 'POST' , 'root' => ''], |
|
| 42 | + ['name' => 'AuthSettings#wipe', 'url' => '/settings/personal/authtokens/wipe/{id}', 'verb' => 'POST', 'root' => ''], |
|
| 43 | 43 | |
| 44 | - ['name' => 'MailSettings#setMailSettings', 'url' => '/settings/admin/mailsettings', 'verb' => 'POST' , 'root' => ''], |
|
| 45 | - ['name' => 'MailSettings#storeCredentials', 'url' => '/settings/admin/mailsettings/credentials', 'verb' => 'POST' , 'root' => ''], |
|
| 46 | - ['name' => 'MailSettings#sendTestMail', 'url' => '/settings/admin/mailtest', 'verb' => 'POST' , 'root' => ''], |
|
| 47 | - ['name' => 'Encryption#startMigration', 'url' => '/settings/admin/startmigration', 'verb' => 'POST' , 'root' => ''], |
|
| 44 | + ['name' => 'MailSettings#setMailSettings', 'url' => '/settings/admin/mailsettings', 'verb' => 'POST', 'root' => ''], |
|
| 45 | + ['name' => 'MailSettings#storeCredentials', 'url' => '/settings/admin/mailsettings/credentials', 'verb' => 'POST', 'root' => ''], |
|
| 46 | + ['name' => 'MailSettings#sendTestMail', 'url' => '/settings/admin/mailtest', 'verb' => 'POST', 'root' => ''], |
|
| 47 | + ['name' => 'Encryption#startMigration', 'url' => '/settings/admin/startmigration', 'verb' => 'POST', 'root' => ''], |
|
| 48 | 48 | |
| 49 | - ['name' => 'AppSettings#listCategories', 'url' => '/settings/apps/categories', 'verb' => 'GET' , 'root' => ''], |
|
| 50 | - ['name' => 'AppSettings#viewApps', 'url' => '/settings/apps', 'verb' => 'GET' , 'root' => ''], |
|
| 51 | - ['name' => 'AppSettings#listApps', 'url' => '/settings/apps/list', 'verb' => 'GET' , 'root' => ''], |
|
| 52 | - ['name' => 'AppSettings#enableApp', 'url' => '/settings/apps/enable/{appId}', 'verb' => 'GET' , 'root' => ''], |
|
| 53 | - ['name' => 'AppSettings#enableApp', 'url' => '/settings/apps/enable/{appId}', 'verb' => 'POST' , 'root' => ''], |
|
| 54 | - ['name' => 'AppSettings#enableApps', 'url' => '/settings/apps/enable', 'verb' => 'POST' , 'root' => ''], |
|
| 55 | - ['name' => 'AppSettings#disableApp', 'url' => '/settings/apps/disable/{appId}', 'verb' => 'GET' , 'root' => ''], |
|
| 56 | - ['name' => 'AppSettings#disableApps', 'url' => '/settings/apps/disable', 'verb' => 'POST' , 'root' => ''], |
|
| 57 | - ['name' => 'AppSettings#updateApp', 'url' => '/settings/apps/update/{appId}', 'verb' => 'GET' , 'root' => ''], |
|
| 58 | - ['name' => 'AppSettings#uninstallApp', 'url' => '/settings/apps/uninstall/{appId}', 'verb' => 'GET' , 'root' => ''], |
|
| 59 | - ['name' => 'AppSettings#viewApps', 'url' => '/settings/apps/{category}', 'verb' => 'GET', 'defaults' => ['category' => ''] , 'root' => ''], |
|
| 60 | - ['name' => 'AppSettings#viewApps', 'url' => '/settings/apps/{category}/{id}', 'verb' => 'GET', 'defaults' => ['category' => '', 'id' => ''] , 'root' => ''], |
|
| 61 | - ['name' => 'AppSettings#force', 'url' => '/settings/apps/force', 'verb' => 'POST' , 'root' => ''], |
|
| 49 | + ['name' => 'AppSettings#listCategories', 'url' => '/settings/apps/categories', 'verb' => 'GET', 'root' => ''], |
|
| 50 | + ['name' => 'AppSettings#viewApps', 'url' => '/settings/apps', 'verb' => 'GET', 'root' => ''], |
|
| 51 | + ['name' => 'AppSettings#listApps', 'url' => '/settings/apps/list', 'verb' => 'GET', 'root' => ''], |
|
| 52 | + ['name' => 'AppSettings#enableApp', 'url' => '/settings/apps/enable/{appId}', 'verb' => 'GET', 'root' => ''], |
|
| 53 | + ['name' => 'AppSettings#enableApp', 'url' => '/settings/apps/enable/{appId}', 'verb' => 'POST', 'root' => ''], |
|
| 54 | + ['name' => 'AppSettings#enableApps', 'url' => '/settings/apps/enable', 'verb' => 'POST', 'root' => ''], |
|
| 55 | + ['name' => 'AppSettings#disableApp', 'url' => '/settings/apps/disable/{appId}', 'verb' => 'GET', 'root' => ''], |
|
| 56 | + ['name' => 'AppSettings#disableApps', 'url' => '/settings/apps/disable', 'verb' => 'POST', 'root' => ''], |
|
| 57 | + ['name' => 'AppSettings#updateApp', 'url' => '/settings/apps/update/{appId}', 'verb' => 'GET', 'root' => ''], |
|
| 58 | + ['name' => 'AppSettings#uninstallApp', 'url' => '/settings/apps/uninstall/{appId}', 'verb' => 'GET', 'root' => ''], |
|
| 59 | + ['name' => 'AppSettings#viewApps', 'url' => '/settings/apps/{category}', 'verb' => 'GET', 'defaults' => ['category' => ''], 'root' => ''], |
|
| 60 | + ['name' => 'AppSettings#viewApps', 'url' => '/settings/apps/{category}/{id}', 'verb' => 'GET', 'defaults' => ['category' => '', 'id' => ''], 'root' => ''], |
|
| 61 | + ['name' => 'AppSettings#force', 'url' => '/settings/apps/force', 'verb' => 'POST', 'root' => ''], |
|
| 62 | 62 | |
| 63 | - ['name' => 'Users#setDisplayName', 'url' => '/settings/users/{username}/displayName', 'verb' => 'POST' , 'root' => ''], |
|
| 64 | - ['name' => 'Users#setEMailAddress', 'url' => '/settings/users/{id}/mailAddress', 'verb' => 'PUT' , 'root' => ''], |
|
| 65 | - ['name' => 'Users#setUserSettings', 'url' => '/settings/users/{username}/settings', 'verb' => 'PUT' , 'root' => ''], |
|
| 66 | - ['name' => 'Users#getVerificationCode', 'url' => '/settings/users/{account}/verify', 'verb' => 'GET' , 'root' => ''], |
|
| 67 | - ['name' => 'Users#usersList', 'url' => '/settings/users', 'verb' => 'GET' , 'root' => ''], |
|
| 68 | - ['name' => 'Users#usersListByGroup', 'url' => '/settings/users/{group}', 'verb' => 'GET', 'requirements' => ['group' => '.+'] , 'root' => ''], |
|
| 69 | - ['name' => 'Users#setPreference', 'url' => '/settings/users/preferences/{key}', 'verb' => 'POST' , 'root' => ''], |
|
| 70 | - ['name' => 'LogSettings#setLogLevel', 'url' => '/settings/admin/log/level', 'verb' => 'POST' , 'root' => ''], |
|
| 71 | - ['name' => 'LogSettings#getEntries', 'url' => '/settings/admin/log/entries', 'verb' => 'GET' , 'root' => ''], |
|
| 72 | - ['name' => 'LogSettings#download', 'url' => '/settings/admin/log/download', 'verb' => 'GET' , 'root' => ''], |
|
| 73 | - ['name' => 'CheckSetup#check', 'url' => '/settings/ajax/checksetup', 'verb' => 'GET' , 'root' => ''], |
|
| 74 | - ['name' => 'CheckSetup#getFailedIntegrityCheckFiles', 'url' => '/settings/integrity/failed', 'verb' => 'GET' , 'root' => ''], |
|
| 75 | - ['name' => 'CheckSetup#rescanFailedIntegrityCheck', 'url' => '/settings/integrity/rescan', 'verb' => 'GET' , 'root' => ''], |
|
| 76 | - ['name' => 'Certificate#addPersonalRootCertificate', 'url' => '/settings/personal/certificate', 'verb' => 'POST' , 'root' => ''], |
|
| 77 | - ['name' => 'Certificate#removePersonalRootCertificate', 'url' => '/settings/personal/certificate/{certificateIdentifier}', 'verb' => 'DELETE' , 'root' => ''], |
|
| 78 | - ['name' => 'Certificate#addSystemRootCertificate', 'url' => '/settings/admin/certificate', 'verb' => 'POST' , 'root' => ''], |
|
| 79 | - ['name' => 'Certificate#removeSystemRootCertificate', 'url' => '/settings/admin/certificate/{certificateIdentifier}', 'verb' => 'DELETE' , 'root' => ''], |
|
| 80 | - ['name' => 'PersonalSettings#index', 'url' => '/settings/user/{section}', 'verb' => 'GET', 'defaults' => ['section' => 'personal-info'] , 'root' => ''], |
|
| 81 | - ['name' => 'AdminSettings#index', 'url' => '/settings/admin/{section}', 'verb' => 'GET', 'defaults' => ['section' => 'server'] , 'root' => ''], |
|
| 82 | - ['name' => 'AdminSettings#form', 'url' => '/settings/admin/{section}', 'verb' => 'GET' , 'root' => ''], |
|
| 83 | - ['name' => 'ChangePassword#changePersonalPassword', 'url' => '/settings/personal/changepassword', 'verb' => 'POST' , 'root' => ''], |
|
| 84 | - ['name' => 'ChangePassword#changeUserPassword', 'url' => '/settings/users/changepassword', 'verb' => 'POST' , 'root' => ''], |
|
| 85 | - ['name' => 'TwoFactorSettings#index', 'url' => '/settings/api/admin/twofactorauth', 'verb' => 'GET' , 'root' => ''], |
|
| 86 | - ['name' => 'TwoFactorSettings#update', 'url' => '/settings/api/admin/twofactorauth', 'verb' => 'PUT' , 'root' => ''], |
|
| 63 | + ['name' => 'Users#setDisplayName', 'url' => '/settings/users/{username}/displayName', 'verb' => 'POST', 'root' => ''], |
|
| 64 | + ['name' => 'Users#setEMailAddress', 'url' => '/settings/users/{id}/mailAddress', 'verb' => 'PUT', 'root' => ''], |
|
| 65 | + ['name' => 'Users#setUserSettings', 'url' => '/settings/users/{username}/settings', 'verb' => 'PUT', 'root' => ''], |
|
| 66 | + ['name' => 'Users#getVerificationCode', 'url' => '/settings/users/{account}/verify', 'verb' => 'GET', 'root' => ''], |
|
| 67 | + ['name' => 'Users#usersList', 'url' => '/settings/users', 'verb' => 'GET', 'root' => ''], |
|
| 68 | + ['name' => 'Users#usersListByGroup', 'url' => '/settings/users/{group}', 'verb' => 'GET', 'requirements' => ['group' => '.+'], 'root' => ''], |
|
| 69 | + ['name' => 'Users#setPreference', 'url' => '/settings/users/preferences/{key}', 'verb' => 'POST', 'root' => ''], |
|
| 70 | + ['name' => 'LogSettings#setLogLevel', 'url' => '/settings/admin/log/level', 'verb' => 'POST', 'root' => ''], |
|
| 71 | + ['name' => 'LogSettings#getEntries', 'url' => '/settings/admin/log/entries', 'verb' => 'GET', 'root' => ''], |
|
| 72 | + ['name' => 'LogSettings#download', 'url' => '/settings/admin/log/download', 'verb' => 'GET', 'root' => ''], |
|
| 73 | + ['name' => 'CheckSetup#check', 'url' => '/settings/ajax/checksetup', 'verb' => 'GET', 'root' => ''], |
|
| 74 | + ['name' => 'CheckSetup#getFailedIntegrityCheckFiles', 'url' => '/settings/integrity/failed', 'verb' => 'GET', 'root' => ''], |
|
| 75 | + ['name' => 'CheckSetup#rescanFailedIntegrityCheck', 'url' => '/settings/integrity/rescan', 'verb' => 'GET', 'root' => ''], |
|
| 76 | + ['name' => 'Certificate#addPersonalRootCertificate', 'url' => '/settings/personal/certificate', 'verb' => 'POST', 'root' => ''], |
|
| 77 | + ['name' => 'Certificate#removePersonalRootCertificate', 'url' => '/settings/personal/certificate/{certificateIdentifier}', 'verb' => 'DELETE', 'root' => ''], |
|
| 78 | + ['name' => 'Certificate#addSystemRootCertificate', 'url' => '/settings/admin/certificate', 'verb' => 'POST', 'root' => ''], |
|
| 79 | + ['name' => 'Certificate#removeSystemRootCertificate', 'url' => '/settings/admin/certificate/{certificateIdentifier}', 'verb' => 'DELETE', 'root' => ''], |
|
| 80 | + ['name' => 'PersonalSettings#index', 'url' => '/settings/user/{section}', 'verb' => 'GET', 'defaults' => ['section' => 'personal-info'], 'root' => ''], |
|
| 81 | + ['name' => 'AdminSettings#index', 'url' => '/settings/admin/{section}', 'verb' => 'GET', 'defaults' => ['section' => 'server'], 'root' => ''], |
|
| 82 | + ['name' => 'AdminSettings#form', 'url' => '/settings/admin/{section}', 'verb' => 'GET', 'root' => ''], |
|
| 83 | + ['name' => 'ChangePassword#changePersonalPassword', 'url' => '/settings/personal/changepassword', 'verb' => 'POST', 'root' => ''], |
|
| 84 | + ['name' => 'ChangePassword#changeUserPassword', 'url' => '/settings/users/changepassword', 'verb' => 'POST', 'root' => ''], |
|
| 85 | + ['name' => 'TwoFactorSettings#index', 'url' => '/settings/api/admin/twofactorauth', 'verb' => 'GET', 'root' => ''], |
|
| 86 | + ['name' => 'TwoFactorSettings#update', 'url' => '/settings/api/admin/twofactorauth', 'verb' => 'PUT', 'root' => ''], |
|
| 87 | 87 | |
| 88 | - ['name' => 'Help#help', 'url' => '/settings/help/{mode}', 'verb' => 'GET', 'defaults' => ['mode' => ''] , 'root' => ''], |
|
| 88 | + ['name' => 'Help#help', 'url' => '/settings/help/{mode}', 'verb' => 'GET', 'defaults' => ['mode' => ''], 'root' => ''], |
|
| 89 | 89 | |
| 90 | - ['name' => 'WebAuthn#startRegistration', 'url' => '/settings/api/personal/webauthn/registration', 'verb' => 'GET' , 'root' => ''], |
|
| 91 | - ['name' => 'WebAuthn#finishRegistration', 'url' => '/settings/api/personal/webauthn/registration', 'verb' => 'POST' , 'root' => ''], |
|
| 92 | - ['name' => 'WebAuthn#deleteRegistration', 'url' => '/settings/api/personal/webauthn/registration/{id}', 'verb' => 'DELETE' , 'root' => ''], |
|
| 90 | + ['name' => 'WebAuthn#startRegistration', 'url' => '/settings/api/personal/webauthn/registration', 'verb' => 'GET', 'root' => ''], |
|
| 91 | + ['name' => 'WebAuthn#finishRegistration', 'url' => '/settings/api/personal/webauthn/registration', 'verb' => 'POST', 'root' => ''], |
|
| 92 | + ['name' => 'WebAuthn#deleteRegistration', 'url' => '/settings/api/personal/webauthn/registration/{id}', 'verb' => 'DELETE', 'root' => ''], |
|
| 93 | 93 | ] |
| 94 | 94 | ]; |