Completed
Pull Request — master (#8909)
by Joas
42:29 queued 18:57
created
core/routes.php 1 patch
Indentation   +79 added lines, -79 removed lines patch added patch discarded remove patch
@@ -36,46 +36,46 @@  discard block
 block discarded – undo
36 36
 
37 37
 $application = new Application();
38 38
 $application->registerRoutes($this, [
39
-	'routes' => [
40
-		['name' => 'lost#email', 'url' => '/lostpassword/email', 'verb' => 'POST'],
41
-		['name' => 'lost#resetform', 'url' => '/lostpassword/reset/form/{token}/{userId}', 'verb' => 'GET'],
42
-		['name' => 'lost#setPassword', 'url' => '/lostpassword/set/{token}/{userId}', 'verb' => 'POST'],
43
-		['name' => 'user#getDisplayNames', 'url' => '/displaynames', 'verb' => 'POST'],
44
-		['name' => 'avatar#getAvatar', 'url' => '/avatar/{userId}/{size}', 'verb' => 'GET'],
45
-		['name' => 'avatar#deleteAvatar', 'url' => '/avatar/', 'verb' => 'DELETE'],
46
-		['name' => 'avatar#postCroppedAvatar', 'url' => '/avatar/cropped', 'verb' => 'POST'],
47
-		['name' => 'avatar#getTmpAvatar', 'url' => '/avatar/tmp', 'verb' => 'GET'],
48
-		['name' => 'avatar#postAvatar', 'url' => '/avatar/', 'verb' => 'POST'],
49
-		['name' => 'CSRFToken#index', 'url' => '/csrftoken', 'verb' => 'GET'],
50
-		['name' => 'login#tryLogin', 'url' => '/login', 'verb' => 'POST'],
51
-		['name' => 'login#confirmPassword', 'url' => '/login/confirm', 'verb' => 'POST'],
52
-		['name' => 'login#showLoginForm', 'url' => '/login', 'verb' => 'GET'],
53
-		['name' => 'login#logout', 'url' => '/logout', 'verb' => 'GET'],
54
-		['name' => 'ClientFlowLogin#showAuthPickerPage', 'url' => '/login/flow', 'verb' => 'GET'],
55
-		['name' => 'ClientFlowLogin#redirectPage', 'url' => '/login/flow/redirect', 'verb' => 'GET'],
56
-		['name' => 'ClientFlowLogin#generateAppPassword', 'url' => '/login/flow', 'verb' => 'POST'],
57
-		['name' => 'TwoFactorChallenge#selectChallenge', 'url' => '/login/selectchallenge', 'verb' => 'GET'],
58
-		['name' => 'TwoFactorChallenge#showChallenge', 'url' => '/login/challenge/{challengeProviderId}', 'verb' => 'GET'],
59
-		['name' => 'TwoFactorChallenge#solveChallenge', 'url' => '/login/challenge/{challengeProviderId}', 'verb' => 'POST'],
60
-		['name' => 'OCJS#getConfig', 'url' => '/core/js/oc.js', 'verb' => 'GET'],
61
-		['name' => 'Preview#getPreviewByFileId', 'url' => '/core/preview', 'verb' => 'GET'],
62
-		['name' => 'Preview#getPreview', 'url' => '/core/preview.png', 'verb' => 'GET'],
63
-		['name' => 'Css#getCss', 'url' => '/css/{appName}/{fileName}', 'verb' => 'GET'],
64
-		['name' => 'Js#getJs', 'url' => '/js/{appName}/{fileName}', 'verb' => 'GET'],
65
-		['name' => 'contactsMenu#index', 'url' => '/contactsmenu/contacts', 'verb' => 'POST'],
66
-		['name' => 'contactsMenu#findOne', 'url' => '/contactsmenu/findOne', 'verb' => 'POST'],
67
-		['name' => 'WalledGarden#get', 'url' => '/204', 'verb' => 'GET'],
68
-		['name' => 'Search#search', 'url' => '/core/search', 'verb' => 'GET'],
69
-	],
70
-	'ocs' => [
71
-		['root' => '/cloud', 'name' => 'OCS#getCapabilities', 'url' => '/capabilities', 'verb' => 'GET'],
72
-		['root' => '', 'name' => 'OCS#getConfig', 'url' => '/config', 'verb' => 'GET'],
73
-		['root' => '/person', 'name' => 'OCS#personCheck', 'url' => '/check', 'verb' => 'POST'],
74
-		['root' => '/identityproof', 'name' => 'OCS#getIdentityProof', 'url' => '/key/{cloudId}', 'verb' => 'GET'],
75
-		['root' => '/core', 'name' => 'Navigation#getAppsNavigation', 'url' => '/navigation/apps', 'verb' => 'GET'],
76
-		['root' => '/core', 'name' => 'Navigation#getSettingsNavigation', 'url' => '/navigation/settings', 'verb' => 'GET'],
77
-		['root' => '/core', 'name' => 'AutoComplete#get', 'url' => '/autocomplete/get', 'verb' => 'GET'],
78
-	],
39
+    'routes' => [
40
+        ['name' => 'lost#email', 'url' => '/lostpassword/email', 'verb' => 'POST'],
41
+        ['name' => 'lost#resetform', 'url' => '/lostpassword/reset/form/{token}/{userId}', 'verb' => 'GET'],
42
+        ['name' => 'lost#setPassword', 'url' => '/lostpassword/set/{token}/{userId}', 'verb' => 'POST'],
43
+        ['name' => 'user#getDisplayNames', 'url' => '/displaynames', 'verb' => 'POST'],
44
+        ['name' => 'avatar#getAvatar', 'url' => '/avatar/{userId}/{size}', 'verb' => 'GET'],
45
+        ['name' => 'avatar#deleteAvatar', 'url' => '/avatar/', 'verb' => 'DELETE'],
46
+        ['name' => 'avatar#postCroppedAvatar', 'url' => '/avatar/cropped', 'verb' => 'POST'],
47
+        ['name' => 'avatar#getTmpAvatar', 'url' => '/avatar/tmp', 'verb' => 'GET'],
48
+        ['name' => 'avatar#postAvatar', 'url' => '/avatar/', 'verb' => 'POST'],
49
+        ['name' => 'CSRFToken#index', 'url' => '/csrftoken', 'verb' => 'GET'],
50
+        ['name' => 'login#tryLogin', 'url' => '/login', 'verb' => 'POST'],
51
+        ['name' => 'login#confirmPassword', 'url' => '/login/confirm', 'verb' => 'POST'],
52
+        ['name' => 'login#showLoginForm', 'url' => '/login', 'verb' => 'GET'],
53
+        ['name' => 'login#logout', 'url' => '/logout', 'verb' => 'GET'],
54
+        ['name' => 'ClientFlowLogin#showAuthPickerPage', 'url' => '/login/flow', 'verb' => 'GET'],
55
+        ['name' => 'ClientFlowLogin#redirectPage', 'url' => '/login/flow/redirect', 'verb' => 'GET'],
56
+        ['name' => 'ClientFlowLogin#generateAppPassword', 'url' => '/login/flow', 'verb' => 'POST'],
57
+        ['name' => 'TwoFactorChallenge#selectChallenge', 'url' => '/login/selectchallenge', 'verb' => 'GET'],
58
+        ['name' => 'TwoFactorChallenge#showChallenge', 'url' => '/login/challenge/{challengeProviderId}', 'verb' => 'GET'],
59
+        ['name' => 'TwoFactorChallenge#solveChallenge', 'url' => '/login/challenge/{challengeProviderId}', 'verb' => 'POST'],
60
+        ['name' => 'OCJS#getConfig', 'url' => '/core/js/oc.js', 'verb' => 'GET'],
61
+        ['name' => 'Preview#getPreviewByFileId', 'url' => '/core/preview', 'verb' => 'GET'],
62
+        ['name' => 'Preview#getPreview', 'url' => '/core/preview.png', 'verb' => 'GET'],
63
+        ['name' => 'Css#getCss', 'url' => '/css/{appName}/{fileName}', 'verb' => 'GET'],
64
+        ['name' => 'Js#getJs', 'url' => '/js/{appName}/{fileName}', 'verb' => 'GET'],
65
+        ['name' => 'contactsMenu#index', 'url' => '/contactsmenu/contacts', 'verb' => 'POST'],
66
+        ['name' => 'contactsMenu#findOne', 'url' => '/contactsmenu/findOne', 'verb' => 'POST'],
67
+        ['name' => 'WalledGarden#get', 'url' => '/204', 'verb' => 'GET'],
68
+        ['name' => 'Search#search', 'url' => '/core/search', 'verb' => 'GET'],
69
+    ],
70
+    'ocs' => [
71
+        ['root' => '/cloud', 'name' => 'OCS#getCapabilities', 'url' => '/capabilities', 'verb' => 'GET'],
72
+        ['root' => '', 'name' => 'OCS#getConfig', 'url' => '/config', 'verb' => 'GET'],
73
+        ['root' => '/person', 'name' => 'OCS#personCheck', 'url' => '/check', 'verb' => 'POST'],
74
+        ['root' => '/identityproof', 'name' => 'OCS#getIdentityProof', 'url' => '/key/{cloudId}', 'verb' => 'GET'],
75
+        ['root' => '/core', 'name' => 'Navigation#getAppsNavigation', 'url' => '/navigation/apps', 'verb' => 'GET'],
76
+        ['root' => '/core', 'name' => 'Navigation#getSettingsNavigation', 'url' => '/navigation/settings', 'verb' => 'GET'],
77
+        ['root' => '/core', 'name' => 'AutoComplete#get', 'url' => '/autocomplete/get', 'verb' => 'GET'],
78
+    ],
79 79
 ]);
80 80
 
81 81
 // Post installation check
@@ -84,12 +84,12 @@  discard block
 block discarded – undo
84 84
 // Core ajax actions
85 85
 // Routing
86 86
 $this->create('core_ajax_update', '/core/ajax/update.php')
87
-	->actionInclude('core/ajax/update.php');
87
+    ->actionInclude('core/ajax/update.php');
88 88
 
89 89
 // File routes
90 90
 $this->create('files.viewcontroller.showFile', '/f/{fileid}')->action(function($urlParams) {
91
-	$app = new \OCA\Files\AppInfo\Application($urlParams);
92
-	$app->dispatch('ViewController', 'index');
91
+    $app = new \OCA\Files\AppInfo\Application($urlParams);
92
+    $app->dispatch('ViewController', 'index');
93 93
 });
94 94
 
95 95
 // Call routes
@@ -98,52 +98,52 @@  discard block
 block discarded – undo
98 98
  * @suppress PhanUndeclaredClassMethod
99 99
  */
100 100
 $this->create('spreed.pagecontroller.showCall', '/call/{token}')->action(function($urlParams) {
101
-	if (class_exists(\OCA\Spreed\AppInfo\Application::class, false)) {
102
-		$app = new \OCA\Spreed\AppInfo\Application($urlParams);
103
-		$app->dispatch('PageController', 'index');
104
-	} else {
105
-		throw new \OC\HintException('App spreed is not enabled');
106
-	}
101
+    if (class_exists(\OCA\Spreed\AppInfo\Application::class, false)) {
102
+        $app = new \OCA\Spreed\AppInfo\Application($urlParams);
103
+        $app->dispatch('PageController', 'index');
104
+    } else {
105
+        throw new \OC\HintException('App spreed is not enabled');
106
+    }
107 107
 });
108 108
 
109 109
 // Sharing routes
110 110
 $this->create('files_sharing.sharecontroller.showShare', '/s/{token}')->action(function($urlParams) {
111
-	if (class_exists(\OCA\Files_Sharing\AppInfo\Application::class, false)) {
112
-		$app = new \OCA\Files_Sharing\AppInfo\Application($urlParams);
113
-		$app->dispatch('ShareController', 'showShare');
114
-	} else {
115
-		throw new \OC\HintException('App file sharing is not enabled');
116
-	}
111
+    if (class_exists(\OCA\Files_Sharing\AppInfo\Application::class, false)) {
112
+        $app = new \OCA\Files_Sharing\AppInfo\Application($urlParams);
113
+        $app->dispatch('ShareController', 'showShare');
114
+    } else {
115
+        throw new \OC\HintException('App file sharing is not enabled');
116
+    }
117 117
 });
118 118
 $this->create('files_sharing.sharecontroller.authenticate', '/s/{token}/authenticate/{redirect}')->post()->action(function($urlParams) {
119
-	if (class_exists(\OCA\Files_Sharing\AppInfo\Application::class, false)) {
120
-		$app = new \OCA\Files_Sharing\AppInfo\Application($urlParams);
121
-		$app->dispatch('ShareController', 'authenticate');
122
-	} else {
123
-		throw new \OC\HintException('App file sharing is not enabled');
124
-	}
119
+    if (class_exists(\OCA\Files_Sharing\AppInfo\Application::class, false)) {
120
+        $app = new \OCA\Files_Sharing\AppInfo\Application($urlParams);
121
+        $app->dispatch('ShareController', 'authenticate');
122
+    } else {
123
+        throw new \OC\HintException('App file sharing is not enabled');
124
+    }
125 125
 });
126 126
 $this->create('files_sharing.sharecontroller.showAuthenticate', '/s/{token}/authenticate/{redirect}')->get()->action(function($urlParams) {
127
-	if (class_exists(\OCA\Files_Sharing\AppInfo\Application::class, false)) {
128
-		$app = new \OCA\Files_Sharing\AppInfo\Application($urlParams);
129
-		$app->dispatch('ShareController', 'showAuthenticate');
130
-	} else {
131
-		throw new \OC\HintException('App file sharing is not enabled');
132
-	}
127
+    if (class_exists(\OCA\Files_Sharing\AppInfo\Application::class, false)) {
128
+        $app = new \OCA\Files_Sharing\AppInfo\Application($urlParams);
129
+        $app->dispatch('ShareController', 'showAuthenticate');
130
+    } else {
131
+        throw new \OC\HintException('App file sharing is not enabled');
132
+    }
133 133
 });
134 134
 $this->create('files_sharing.sharecontroller.downloadShare', '/s/{token}/download')->get()->action(function($urlParams) {
135
-	if (class_exists(\OCA\Files_Sharing\AppInfo\Application::class, false)) {
136
-		$app = new \OCA\Files_Sharing\AppInfo\Application($urlParams);
137
-		$app->dispatch('ShareController', 'downloadShare');
138
-	} else {
139
-		throw new \OC\HintException('App file sharing is not enabled');
140
-	}
135
+    if (class_exists(\OCA\Files_Sharing\AppInfo\Application::class, false)) {
136
+        $app = new \OCA\Files_Sharing\AppInfo\Application($urlParams);
137
+        $app->dispatch('ShareController', 'downloadShare');
138
+    } else {
139
+        throw new \OC\HintException('App file sharing is not enabled');
140
+    }
141 141
 });
142 142
 $this->create('files_sharing.publicpreview.directLink', '/s/{token}/preview')->get()->action(function($urlParams) {
143
-	if (class_exists(\OCA\Files_Sharing\AppInfo\Application::class, false)) {
144
-		$app = new \OCA\Files_Sharing\AppInfo\Application($urlParams);
145
-		$app->dispatch('PublicPreviewController', 'directLink');
146
-	} else {
147
-		throw new \OC\HintException('App file sharing is not enabled');
148
-	}
143
+    if (class_exists(\OCA\Files_Sharing\AppInfo\Application::class, false)) {
144
+        $app = new \OCA\Files_Sharing\AppInfo\Application($urlParams);
145
+        $app->dispatch('PublicPreviewController', 'directLink');
146
+    } else {
147
+        throw new \OC\HintException('App file sharing is not enabled');
148
+    }
149 149
 });
Please login to merge, or discard this patch.