Passed
Push — master ( 16497b...96d7e4 )
by Jan
05:37 queued 12s
created
src/Controller/RedirectController.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
 
63 63
         //Check if a user has set a preferred language setting:
64 64
         $user = $this->getUser();
65
-        if (($user instanceof User) && ! empty($user->getLanguage())) {
65
+        if (($user instanceof User) && !empty($user->getLanguage())) {
66 66
             $locale = $user->getLanguage();
67 67
         }
68 68
 
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
         $new_url = $request->getUriForPath('/'.$locale.$request->getPathInfo());
71 71
 
72 72
         //If either mod_rewrite is not enabled or the index.php version is enforced, add index.php to the string
73
-        if (($this->enforce_index_php || ! $this->checkIfModRewriteAvailable())
73
+        if (($this->enforce_index_php || !$this->checkIfModRewriteAvailable())
74 74
             && false === strpos($new_url, 'index.php')) {
75 75
             //Like Request::getUriForPath only with index.php
76 76
             $new_url = $request->getSchemeAndHttpHost().$request->getBaseUrl().'/index.php/'.$locale.$request->getPathInfo();
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
      */
89 89
     public function checkIfModRewriteAvailable(): bool
90 90
     {
91
-        if (! function_exists('apache_get_modules')) {
91
+        if (!function_exists('apache_get_modules')) {
92 92
             //If we can not check for apache modules, we just hope for the best and assume url rewriting is available
93 93
             //If you want to enforce index.php versions of the url, you can override this via ENV vars.
94 94
             return true;
Please login to merge, or discard this patch.
src/Controller/UserController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -156,7 +156,7 @@
 block discarded – undo
156 156
         //If no user id was passed, then we show info about the current user
157 157
         if (null === $user) {
158 158
             $tmp = $this->getUser();
159
-            if(!$tmp instanceof User) {
159
+            if (!$tmp instanceof User) {
160 160
                 throw new InvalidArgumentException('Userinfo only works for database users!');
161 161
             }
162 162
             $user = $tmp;
Please login to merge, or discard this patch.
src/Controller/UserSettingsController.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
         //When user change its settings, he should be logged  in fully.
67 67
         $this->denyAccessUnlessGranted('IS_AUTHENTICATED_FULLY');
68 68
 
69
-        if (! $user instanceof User) {
69
+        if (!$user instanceof User) {
70 70
             return new RuntimeException('This controller only works only for Part-DB User objects!');
71 71
         }
72 72
 
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
         //When user change its settings, he should be logged  in fully.
101 101
         $this->denyAccessUnlessGranted('IS_AUTHENTICATED_FULLY');
102 102
 
103
-        if (! $user instanceof User) {
103
+        if (!$user instanceof User) {
104 104
             throw new RuntimeException('This controller only works only for Part-DB User objects!');
105 105
         }
106 106
 
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
         //When user change its settings, he should be logged  in fully.
153 153
         $this->denyAccessUnlessGranted('IS_AUTHENTICATED_FULLY');
154 154
 
155
-        if (! $user instanceof User) {
155
+        if (!$user instanceof User) {
156 156
             return new RuntimeException('This controller only works only for Part-DB User objects!');
157 157
         }
158 158
 
@@ -186,7 +186,7 @@  discard block
 block discarded – undo
186 186
         //When user change its settings, he should be logged  in fully.
187 187
         $this->denyAccessUnlessGranted('IS_AUTHENTICATED_FULLY');
188 188
 
189
-        if (! $user instanceof User) {
189
+        if (!$user instanceof User) {
190 190
             throw new RuntimeException('This controller only works only for Part-DB User objects!');
191 191
         }
192 192
 
@@ -198,7 +198,7 @@  discard block
 block discarded – undo
198 198
 
199 199
         $form->handleRequest($request);
200 200
 
201
-        if (! $this->demo_mode && $form->isSubmitted() && $form->isValid()) {
201
+        if (!$this->demo_mode && $form->isSubmitted() && $form->isValid()) {
202 202
             //Check if user theme setting has changed
203 203
             if ($user->getTheme() !== $em->getUnitOfWork()->getOriginalEntityData($user)['theme']) {
204 204
                 $page_need_reload = true;
@@ -258,7 +258,7 @@  discard block
 block discarded – undo
258 258
         $pw_form->handleRequest($request);
259 259
 
260 260
         //Check if password if everything was correct, then save it to User and DB
261
-        if (! $this->demo_mode && $pw_form->isSubmitted() && $pw_form->isValid()) {
261
+        if (!$this->demo_mode && $pw_form->isSubmitted() && $pw_form->isValid()) {
262 262
             $password = $passwordEncoder->encodePassword($user, $pw_form['new_password']->getData());
263 263
             $user->setPassword($password);
264 264
 
@@ -273,14 +273,14 @@  discard block
 block discarded – undo
273 273
         //Handle 2FA things
274 274
         $google_form = $this->createForm(TFAGoogleSettingsType::class, $user);
275 275
         $google_enabled = $user->isGoogleAuthenticatorEnabled();
276
-        if (! $google_enabled && ! $form->isSubmitted()) {
276
+        if (!$google_enabled && !$form->isSubmitted()) {
277 277
             $user->setGoogleAuthenticatorSecret($googleAuthenticator->generateSecret());
278 278
             $google_form->get('googleAuthenticatorSecret')->setData($user->getGoogleAuthenticatorSecret());
279 279
         }
280 280
         $google_form->handleRequest($request);
281 281
 
282
-        if ( ! $this->demo_mode && $google_form->isSubmitted() && $google_form->isValid()) {
283
-            if (! $google_enabled) {
282
+        if (!$this->demo_mode && $google_form->isSubmitted() && $google_form->isValid()) {
283
+            if (!$google_enabled) {
284 284
                 //Save 2FA settings (save secrets)
285 285
                 $user->setGoogleAuthenticatorSecret($google_form->get('googleAuthenticatorSecret')->getData());
286 286
                 $backupCodeManager->enableBackupCodes($user);
@@ -308,7 +308,7 @@  discard block
 block discarded – undo
308 308
         ])->getForm();
309 309
 
310 310
         $backup_form->handleRequest($request);
311
-        if (! $this->demo_mode && $backup_form->isSubmitted() && $backup_form->isValid()) {
311
+        if (!$this->demo_mode && $backup_form->isSubmitted() && $backup_form->isValid()) {
312 312
             $backupCodeManager->regenerateBackupCodes($user);
313 313
             $em->flush();
314 314
             $this->addFlash('success', 'user.settings.2fa.backup_codes.regenerated');
Please login to merge, or discard this patch.