@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | * @param array $urlParams |
82 | 82 | * @param ServerContainer|null $server |
83 | 83 | */ |
84 | - public function __construct($appName, $urlParams = array(), ServerContainer $server = null){ |
|
84 | + public function __construct($appName, $urlParams = array(), ServerContainer $server = null) { |
|
85 | 85 | parent::__construct(); |
86 | 86 | $this['AppName'] = $appName; |
87 | 87 | $this['urlParams'] = $urlParams; |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | /** |
102 | 102 | * Core services |
103 | 103 | */ |
104 | - $this->registerService(IOutput::class, function($c){ |
|
104 | + $this->registerService(IOutput::class, function($c) { |
|
105 | 105 | return new Output($this->getServer()->getWebRoot()); |
106 | 106 | }); |
107 | 107 | |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | return $this->getServer()->getUserFolder(); |
110 | 110 | }); |
111 | 111 | |
112 | - $this->registerService(IAppData::class, function (SimpleContainer $c) { |
|
112 | + $this->registerService(IAppData::class, function(SimpleContainer $c) { |
|
113 | 113 | return $this->getServer()->getAppDataDir($c->query('AppName')); |
114 | 114 | }); |
115 | 115 | |
@@ -130,25 +130,25 @@ discard block |
||
130 | 130 | |
131 | 131 | $this->registerAlias(\OC\User\Session::class, \OCP\IUserSession::class); |
132 | 132 | |
133 | - $this->registerService(IServerContainer::class, function ($c) { |
|
133 | + $this->registerService(IServerContainer::class, function($c) { |
|
134 | 134 | return $this->getServer(); |
135 | 135 | }); |
136 | 136 | $this->registerAlias('ServerContainer', IServerContainer::class); |
137 | 137 | |
138 | - $this->registerService(\OCP\WorkflowEngine\IManager::class, function ($c) { |
|
138 | + $this->registerService(\OCP\WorkflowEngine\IManager::class, function($c) { |
|
139 | 139 | return $c->query('OCA\WorkflowEngine\Manager'); |
140 | 140 | }); |
141 | 141 | |
142 | - $this->registerService(\OCP\AppFramework\IAppContainer::class, function ($c) { |
|
142 | + $this->registerService(\OCP\AppFramework\IAppContainer::class, function($c) { |
|
143 | 143 | return $c; |
144 | 144 | }); |
145 | 145 | |
146 | 146 | // commonly used attributes |
147 | - $this->registerService('UserId', function ($c) { |
|
147 | + $this->registerService('UserId', function($c) { |
|
148 | 148 | return $c->query('OCP\\IUserSession')->getSession()->get('user_id'); |
149 | 149 | }); |
150 | 150 | |
151 | - $this->registerService('WebRoot', function ($c) { |
|
151 | + $this->registerService('WebRoot', function($c) { |
|
152 | 152 | return $c->query('ServerContainer')->getWebRoot(); |
153 | 153 | }); |
154 | 154 | |
@@ -156,15 +156,15 @@ discard block |
||
156 | 156 | return Util::getDefaultEmailAddress('no-reply'); |
157 | 157 | }); |
158 | 158 | |
159 | - $this->registerService('OC_Defaults', function ($c) { |
|
159 | + $this->registerService('OC_Defaults', function($c) { |
|
160 | 160 | return $c->getServer()->getThemingDefaults(); |
161 | 161 | }); |
162 | 162 | |
163 | - $this->registerService('OCP\Encryption\IManager', function ($c) { |
|
163 | + $this->registerService('OCP\Encryption\IManager', function($c) { |
|
164 | 164 | return $this->getServer()->getEncryptionManager(); |
165 | 165 | }); |
166 | 166 | |
167 | - $this->registerService(IConfig::class, function ($c) { |
|
167 | + $this->registerService(IConfig::class, function($c) { |
|
168 | 168 | return $c->query(OC\GlobalScale\Config::class); |
169 | 169 | }); |
170 | 170 | |
@@ -172,7 +172,7 @@ discard block |
||
172 | 172 | return $c->query(Validator::class); |
173 | 173 | }); |
174 | 174 | |
175 | - $this->registerService(\OC\Security\IdentityProof\Manager::class, function ($c) { |
|
175 | + $this->registerService(\OC\Security\IdentityProof\Manager::class, function($c) { |
|
176 | 176 | return new \OC\Security\IdentityProof\Manager( |
177 | 177 | $this->getServer()->query(\OC\Files\AppData\Factory::class), |
178 | 178 | $this->getServer()->getCrypto(), |
@@ -183,15 +183,15 @@ discard block |
||
183 | 183 | /** |
184 | 184 | * App Framework APIs |
185 | 185 | */ |
186 | - $this->registerService('API', function($c){ |
|
186 | + $this->registerService('API', function($c) { |
|
187 | 187 | $c->query('OCP\\ILogger')->debug( |
188 | - 'Accessing the API class is deprecated! Use the appropriate ' . |
|
188 | + 'Accessing the API class is deprecated! Use the appropriate '. |
|
189 | 189 | 'services instead!' |
190 | 190 | ); |
191 | 191 | return new API($c['AppName']); |
192 | 192 | }); |
193 | 193 | |
194 | - $this->registerService('Protocol', function($c){ |
|
194 | + $this->registerService('Protocol', function($c) { |
|
195 | 195 | /** @var \OC\Server $server */ |
196 | 196 | $server = $c->query('ServerContainer'); |
197 | 197 | $protocol = $server->getRequest()->getHttpProtocol(); |
@@ -238,7 +238,7 @@ discard block |
||
238 | 238 | ); |
239 | 239 | }); |
240 | 240 | |
241 | - $this->registerService(OC\AppFramework\Middleware\Security\PasswordConfirmationMiddleware::class, function ($c) use ($app) { |
|
241 | + $this->registerService(OC\AppFramework\Middleware\Security\PasswordConfirmationMiddleware::class, function($c) use ($app) { |
|
242 | 242 | /** @var \OC\Server $server */ |
243 | 243 | $server = $app->getServer(); |
244 | 244 | |
@@ -290,7 +290,7 @@ discard block |
||
290 | 290 | ); |
291 | 291 | }); |
292 | 292 | |
293 | - $this->registerService('TwoFactorMiddleware', function (SimpleContainer $c) use ($app) { |
|
293 | + $this->registerService('TwoFactorMiddleware', function(SimpleContainer $c) use ($app) { |
|
294 | 294 | $twoFactorManager = $c->getServer()->getTwoFactorAuthManager(); |
295 | 295 | $userSession = $app->getServer()->getUserSession(); |
296 | 296 | $session = $app->getServer()->getSession(); |
@@ -300,13 +300,13 @@ discard block |
||
300 | 300 | return new TwoFactorMiddleware($twoFactorManager, $userSession, $session, $urlGenerator, $reflector, $request); |
301 | 301 | }); |
302 | 302 | |
303 | - $this->registerService('OCSMiddleware', function (SimpleContainer $c) { |
|
303 | + $this->registerService('OCSMiddleware', function(SimpleContainer $c) { |
|
304 | 304 | return new OCSMiddleware( |
305 | 305 | $c['Request'] |
306 | 306 | ); |
307 | 307 | }); |
308 | 308 | |
309 | - $this->registerService(OC\AppFramework\Middleware\Security\SameSiteCookieMiddleware::class, function (SimpleContainer $c) { |
|
309 | + $this->registerService(OC\AppFramework\Middleware\Security\SameSiteCookieMiddleware::class, function(SimpleContainer $c) { |
|
310 | 310 | return new OC\AppFramework\Middleware\Security\SameSiteCookieMiddleware( |
311 | 311 | $c['Request'], |
312 | 312 | $c['ControllerMethodReflector'] |
@@ -325,7 +325,7 @@ discard block |
||
325 | 325 | $dispatcher->registerMiddleware($c['BruteForceMiddleware']); |
326 | 326 | $dispatcher->registerMiddleware($c['RateLimitingMiddleware']); |
327 | 327 | |
328 | - foreach($middleWares as $middleWare) { |
|
328 | + foreach ($middleWares as $middleWare) { |
|
329 | 329 | $dispatcher->registerMiddleware($c[$middleWare]); |
330 | 330 | } |
331 | 331 | |
@@ -397,7 +397,7 @@ discard block |
||
397 | 397 | * @return mixed |
398 | 398 | */ |
399 | 399 | public function log($message, $level) { |
400 | - switch($level){ |
|
400 | + switch ($level) { |
|
401 | 401 | case 'debug': |
402 | 402 | $level = \OCP\Util::DEBUG; |
403 | 403 | break; |
@@ -463,12 +463,12 @@ discard block |
||
463 | 463 | return parent::query($name); |
464 | 464 | } else if ($this['AppName'] === 'core' && strpos($name, 'OC\\Core\\') === 0) { |
465 | 465 | return parent::query($name); |
466 | - } else if (strpos($name, \OC\AppFramework\App::buildAppNamespace($this['AppName']) . '\\') === 0) { |
|
466 | + } else if (strpos($name, \OC\AppFramework\App::buildAppNamespace($this['AppName']).'\\') === 0) { |
|
467 | 467 | return parent::query($name); |
468 | 468 | } |
469 | 469 | } |
470 | 470 | |
471 | - throw new QueryException('Could not resolve ' . $name . '!' . |
|
471 | + throw new QueryException('Could not resolve '.$name.'!'. |
|
472 | 472 | ' Class can not be instantiated', 1); |
473 | 473 | } |
474 | 474 | } |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | $apps = $this->appManager->getEnabledAppsForUser($this->currentUser); |
117 | 117 | } |
118 | 118 | |
119 | - foreach($apps as $app) { |
|
119 | + foreach ($apps as $app) { |
|
120 | 120 | $apps_paths[$app] = \OC_App::getAppWebPath($app); |
121 | 121 | } |
122 | 122 | |
@@ -132,8 +132,8 @@ discard block |
||
132 | 132 | $outgoingServer2serverShareEnabled = $this->config->getAppValue('files_sharing', 'outgoing_server2server_share_enabled', 'yes') === 'yes'; |
133 | 133 | |
134 | 134 | $countOfDataLocation = 0; |
135 | - $dataLocation = str_replace(\OC::$SERVERROOT .'/', '', $this->config->getSystemValue('datadirectory', ''), $countOfDataLocation); |
|
136 | - if($countOfDataLocation !== 1 || !$this->groupManager->isAdmin($uid)) { |
|
135 | + $dataLocation = str_replace(\OC::$SERVERROOT.'/', '', $this->config->getSystemValue('datadirectory', ''), $countOfDataLocation); |
|
136 | + if ($countOfDataLocation !== 1 || !$this->groupManager->isAdmin($uid)) { |
|
137 | 137 | $dataLocation = false; |
138 | 138 | } |
139 | 139 | |
@@ -149,68 +149,68 @@ discard block |
||
149 | 149 | $array = [ |
150 | 150 | "oc_debug" => $this->config->getSystemValue('debug', false) ? 'true' : 'false', |
151 | 151 | "oc_isadmin" => $this->groupManager->isAdmin($uid) ? 'true' : 'false', |
152 | - "backendAllowsPasswordConfirmation" => $userBackend === 'user_saml'? 'false' : 'true', |
|
152 | + "backendAllowsPasswordConfirmation" => $userBackend === 'user_saml' ? 'false' : 'true', |
|
153 | 153 | "oc_dataURL" => is_string($dataLocation) ? "\"".$dataLocation."\"" : 'false', |
154 | 154 | "oc_webroot" => "\"".\OC::$WEBROOT."\"", |
155 | 155 | "oc_appswebroots" => str_replace('\\/', '/', json_encode($apps_paths)), // Ugly unescape slashes waiting for better solution |
156 | 156 | "datepickerFormatDate" => json_encode($this->l->l('jsdate', null)), |
157 | 157 | 'nc_lastLogin' => $lastConfirmTimestamp, |
158 | 158 | "dayNames" => json_encode([ |
159 | - (string)$this->l->t('Sunday'), |
|
160 | - (string)$this->l->t('Monday'), |
|
161 | - (string)$this->l->t('Tuesday'), |
|
162 | - (string)$this->l->t('Wednesday'), |
|
163 | - (string)$this->l->t('Thursday'), |
|
164 | - (string)$this->l->t('Friday'), |
|
165 | - (string)$this->l->t('Saturday') |
|
159 | + (string) $this->l->t('Sunday'), |
|
160 | + (string) $this->l->t('Monday'), |
|
161 | + (string) $this->l->t('Tuesday'), |
|
162 | + (string) $this->l->t('Wednesday'), |
|
163 | + (string) $this->l->t('Thursday'), |
|
164 | + (string) $this->l->t('Friday'), |
|
165 | + (string) $this->l->t('Saturday') |
|
166 | 166 | ]), |
167 | 167 | "dayNamesShort" => json_encode([ |
168 | - (string)$this->l->t('Sun.'), |
|
169 | - (string)$this->l->t('Mon.'), |
|
170 | - (string)$this->l->t('Tue.'), |
|
171 | - (string)$this->l->t('Wed.'), |
|
172 | - (string)$this->l->t('Thu.'), |
|
173 | - (string)$this->l->t('Fri.'), |
|
174 | - (string)$this->l->t('Sat.') |
|
168 | + (string) $this->l->t('Sun.'), |
|
169 | + (string) $this->l->t('Mon.'), |
|
170 | + (string) $this->l->t('Tue.'), |
|
171 | + (string) $this->l->t('Wed.'), |
|
172 | + (string) $this->l->t('Thu.'), |
|
173 | + (string) $this->l->t('Fri.'), |
|
174 | + (string) $this->l->t('Sat.') |
|
175 | 175 | ]), |
176 | 176 | "dayNamesMin" => json_encode([ |
177 | - (string)$this->l->t('Su'), |
|
178 | - (string)$this->l->t('Mo'), |
|
179 | - (string)$this->l->t('Tu'), |
|
180 | - (string)$this->l->t('We'), |
|
181 | - (string)$this->l->t('Th'), |
|
182 | - (string)$this->l->t('Fr'), |
|
183 | - (string)$this->l->t('Sa') |
|
177 | + (string) $this->l->t('Su'), |
|
178 | + (string) $this->l->t('Mo'), |
|
179 | + (string) $this->l->t('Tu'), |
|
180 | + (string) $this->l->t('We'), |
|
181 | + (string) $this->l->t('Th'), |
|
182 | + (string) $this->l->t('Fr'), |
|
183 | + (string) $this->l->t('Sa') |
|
184 | 184 | ]), |
185 | 185 | "monthNames" => json_encode([ |
186 | - (string)$this->l->t('January'), |
|
187 | - (string)$this->l->t('February'), |
|
188 | - (string)$this->l->t('March'), |
|
189 | - (string)$this->l->t('April'), |
|
190 | - (string)$this->l->t('May'), |
|
191 | - (string)$this->l->t('June'), |
|
192 | - (string)$this->l->t('July'), |
|
193 | - (string)$this->l->t('August'), |
|
194 | - (string)$this->l->t('September'), |
|
195 | - (string)$this->l->t('October'), |
|
196 | - (string)$this->l->t('November'), |
|
197 | - (string)$this->l->t('December') |
|
186 | + (string) $this->l->t('January'), |
|
187 | + (string) $this->l->t('February'), |
|
188 | + (string) $this->l->t('March'), |
|
189 | + (string) $this->l->t('April'), |
|
190 | + (string) $this->l->t('May'), |
|
191 | + (string) $this->l->t('June'), |
|
192 | + (string) $this->l->t('July'), |
|
193 | + (string) $this->l->t('August'), |
|
194 | + (string) $this->l->t('September'), |
|
195 | + (string) $this->l->t('October'), |
|
196 | + (string) $this->l->t('November'), |
|
197 | + (string) $this->l->t('December') |
|
198 | 198 | ]), |
199 | 199 | "monthNamesShort" => json_encode([ |
200 | - (string)$this->l->t('Jan.'), |
|
201 | - (string)$this->l->t('Feb.'), |
|
202 | - (string)$this->l->t('Mar.'), |
|
203 | - (string)$this->l->t('Apr.'), |
|
204 | - (string)$this->l->t('May.'), |
|
205 | - (string)$this->l->t('Jun.'), |
|
206 | - (string)$this->l->t('Jul.'), |
|
207 | - (string)$this->l->t('Aug.'), |
|
208 | - (string)$this->l->t('Sep.'), |
|
209 | - (string)$this->l->t('Oct.'), |
|
210 | - (string)$this->l->t('Nov.'), |
|
211 | - (string)$this->l->t('Dec.') |
|
200 | + (string) $this->l->t('Jan.'), |
|
201 | + (string) $this->l->t('Feb.'), |
|
202 | + (string) $this->l->t('Mar.'), |
|
203 | + (string) $this->l->t('Apr.'), |
|
204 | + (string) $this->l->t('May.'), |
|
205 | + (string) $this->l->t('Jun.'), |
|
206 | + (string) $this->l->t('Jul.'), |
|
207 | + (string) $this->l->t('Aug.'), |
|
208 | + (string) $this->l->t('Sep.'), |
|
209 | + (string) $this->l->t('Oct.'), |
|
210 | + (string) $this->l->t('Nov.'), |
|
211 | + (string) $this->l->t('Dec.') |
|
212 | 212 | ]), |
213 | - "firstDay" => json_encode($this->l->l('firstday', null)) , |
|
213 | + "firstDay" => json_encode($this->l->l('firstday', null)), |
|
214 | 214 | "oc_config" => json_encode([ |
215 | 215 | 'session_lifetime' => min($this->config->getSystemValue('session_lifetime', $this->iniWrapper->getNumeric('session.gc_maxlifetime')), $this->iniWrapper->getNumeric('session.gc_maxlifetime')), |
216 | 216 | 'session_keepalive' => $this->config->getSystemValue('session_keepalive', true), |
@@ -256,7 +256,7 @@ discard block |
||
256 | 256 | if ($this->currentUser !== null) { |
257 | 257 | $array['oc_userconfig'] = json_encode([ |
258 | 258 | 'avatar' => [ |
259 | - 'version' => (int)$this->config->getUserValue($uid, 'avatar', 'version', 0), |
|
259 | + 'version' => (int) $this->config->getUserValue($uid, 'avatar', 'version', 0), |
|
260 | 260 | 'generated' => $this->config->getUserValue($uid, 'avatar', 'generated', 'true') === 'true', |
261 | 261 | ] |
262 | 262 | ]); |
@@ -269,7 +269,7 @@ discard block |
||
269 | 269 | |
270 | 270 | // Echo it |
271 | 271 | foreach ($array as $setting => $value) { |
272 | - $result .= 'var '. $setting . '='. $value . ';' . PHP_EOL; |
|
272 | + $result .= 'var '.$setting.'='.$value.';'.PHP_EOL; |
|
273 | 273 | } |
274 | 274 | |
275 | 275 | return $result; |