Passed
Push — master ( 892132...fe0f69 )
by Jan
04:10
created
tests/Controller/AdminPages/AbstractAdminControllerTest.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
         $crawler = $client->request('GET', static::$base_path.'/new');
72 72
         $this->assertFalse($client->getResponse()->isRedirect());
73 73
         $this->assertSame($read, $client->getResponse()->isSuccessful(), 'Controller was not successful!');
74
-        $this->assertSame($read, ! $client->getResponse()->isForbidden(), 'Permission Checking not working!');
74
+        $this->assertSame($read, !$client->getResponse()->isForbidden(), 'Permission Checking not working!');
75 75
     }
76 76
 
77 77
     /**
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
         $crawler = $client->request('GET', static::$base_path.'/1');
97 97
         $this->assertFalse($client->getResponse()->isRedirect());
98 98
         $this->assertSame($read, $client->getResponse()->isSuccessful(), 'Controller was not successful!');
99
-        $this->assertSame($read, ! $client->getResponse()->isForbidden(), 'Permission Checking not working!');
99
+        $this->assertSame($read, !$client->getResponse()->isForbidden(), 'Permission Checking not working!');
100 100
     }
101 101
 
102 102
     public function deleteDataProvider()
@@ -133,6 +133,6 @@  discard block
 block discarded – undo
133 133
 
134 134
         //Page is redirected to '/new', when delete was successful
135 135
         $this->assertSame($delete, $client->getResponse()->isRedirect(static::$base_path.'/new'));
136
-        $this->assertSame($delete, ! $client->getResponse()->isForbidden(), 'Permission Checking not working!');
136
+        $this->assertSame($delete, !$client->getResponse()->isForbidden(), 'Permission Checking not working!');
137 137
     }
138 138
 }
Please login to merge, or discard this patch.
src/Controller/AttachmentFileController.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
             throw new \RuntimeException('You can not download external attachments!');
53 53
         }
54 54
 
55
-        if (! $helper->isFileExisting($attachment)) {
55
+        if (!$helper->isFileExisting($attachment)) {
56 56
             throw new \RuntimeException('The file associated with the attachment is not existing!');
57 57
         }
58 58
 
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
             throw new \RuntimeException('You can not download external attachments!');
83 83
         }
84 84
 
85
-        if (! $helper->isFileExisting($attachment)) {
85
+        if (!$helper->isFileExisting($attachment)) {
86 86
             throw new \RuntimeException('The file associated with the attachment is not existing!');
87 87
         }
88 88
 
Please login to merge, or discard this patch.
src/Controller/RedirectController.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
 
59 59
         //Check if a user has set a preferred language setting:
60 60
         $user = $this->getUser();
61
-        if (($user instanceof User) && ! empty($user->getLanguage())) {
61
+        if (($user instanceof User) && !empty($user->getLanguage())) {
62 62
             $locale = $user->getLanguage();
63 63
         }
64 64
 
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
         $new_url = $request->getUriForPath('/'.$locale.$request->getPathInfo());
67 67
 
68 68
         //If either mod_rewrite is not enabled or the index.php version is enforced, add index.php to the string
69
-        if (($this->enforce_index_php || ! $this->checkIfModRewriteAvailable())
69
+        if (($this->enforce_index_php || !$this->checkIfModRewriteAvailable())
70 70
             && false === strpos($new_url, 'index.php')) {
71 71
             //Like Request::getUriForPath only with index.php
72 72
             $new_url = $request->getSchemeAndHttpHost().$request->getBaseUrl().'/index.php/'.$locale.$request->getPathInfo();
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
      */
85 85
     public function checkIfModRewriteAvailable()
86 86
     {
87
-        if (! \function_exists('apache_get_modules')) {
87
+        if (!\function_exists('apache_get_modules')) {
88 88
             //If we can not check for apache modules, we just hope for the best and assume url rewriting is available
89 89
             //If you want to enforce index.php versions of the url, you can override this via ENV vars.
90 90
             return true;
Please login to merge, or discard this patch.
src/Controller/PartController.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
             $this->addFlash('info', 'part.edited_flash');
104 104
             //Reload form, so the SIUnitType entries use the new part unit
105 105
             $form = $this->createForm(PartBaseType::class, $part);
106
-        } elseif ($form->isSubmitted() && ! $form->isValid()) {
106
+        } elseif ($form->isSubmitted() && !$form->isValid()) {
107 107
             $this->addFlash('error', 'part.edited_flash.invalid');
108 108
         }
109 109
 
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
             return $this->redirectToRoute('part_edit', ['id' => $new_part->getID()]);
190 190
         }
191 191
 
192
-        if ($form->isSubmitted() && ! $form->isValid()) {
192
+        if ($form->isSubmitted() && !$form->isValid()) {
193 193
             $this->addFlash('error', 'part.created_flash.invalid');
194 194
         }
195 195
 
Please login to merge, or discard this patch.
src/Controller/SecurityController.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
      */
73 73
     public function requestPwReset(PasswordResetManager $passwordReset, Request $request)
74 74
     {
75
-        if (! $this->allow_email_pw_reset) {
75
+        if (!$this->allow_email_pw_reset) {
76 76
             throw new AccessDeniedHttpException('The password reset via email is disabled!');
77 77
         }
78 78
 
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
      */
115 115
     public function pwResetNewPw(PasswordResetManager $passwordReset, Request $request, ?string $user = null, ?string $token = null)
116 116
     {
117
-        if (! $this->allow_email_pw_reset) {
117
+        if (!$this->allow_email_pw_reset) {
118 118
             throw new AccessDeniedHttpException('The password reset via email is disabled!');
119 119
         }
120 120
 
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
             $data = $form->getData();
153 153
             //Try to set the new password
154 154
             $success = $passwordReset->setNewPassword($data['username'], $data['token'], $data['new_password']);
155
-            if (! $success) {
155
+            if (!$success) {
156 156
                 $this->addFlash('error', 'pw_reset.new_pw.error');
157 157
             } else {
158 158
                 $this->addFlash('success', 'pw_reset.new_pw.success');
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
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
         //When user change its settings, he should be logged  in fully.
65 65
         $this->denyAccessUnlessGranted('IS_AUTHENTICATED_FULLY');
66 66
 
67
-        if (! $user instanceof User) {
67
+        if (!$user instanceof User) {
68 68
             return new \RuntimeException('This controller only works only for Part-DB User objects!');
69 69
         }
70 70
 
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
         //When user change its settings, he should be logged  in fully.
96 96
         $this->denyAccessUnlessGranted('IS_AUTHENTICATED_FULLY');
97 97
 
98
-        if (! $user instanceof User) {
98
+        if (!$user instanceof User) {
99 99
             throw new \RuntimeException('This controller only works only for Part-DB User objects!');
100 100
         }
101 101
 
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
         //When user change its settings, he should be logged  in fully.
145 145
         $this->denyAccessUnlessGranted('IS_AUTHENTICATED_FULLY');
146 146
 
147
-        if (! $user instanceof User) {
147
+        if (!$user instanceof User) {
148 148
             return new \RuntimeException('This controller only works only for Part-DB User objects!');
149 149
         }
150 150
 
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
         //When user change its settings, he should be logged  in fully.
173 173
         $this->denyAccessUnlessGranted('IS_AUTHENTICATED_FULLY');
174 174
 
175
-        if (! $user instanceof User) {
175
+        if (!$user instanceof User) {
176 176
             throw new \RuntimeException('This controller only works only for Part-DB User objects!');
177 177
         }
178 178
 
@@ -184,7 +184,7 @@  discard block
 block discarded – undo
184 184
 
185 185
         $form->handleRequest($request);
186 186
 
187
-        if ($form->isSubmitted() && $form->isValid() && ! $this->demo_mode) {
187
+        if ($form->isSubmitted() && $form->isValid() && !$this->demo_mode) {
188 188
             //Check if user theme setting has changed
189 189
             if ($user->getTheme() !== $em->getUnitOfWork()->getOriginalEntityData($user)['theme']) {
190 190
                 $page_need_reload = true;
@@ -231,7 +231,7 @@  discard block
 block discarded – undo
231 231
         $pw_form->handleRequest($request);
232 232
 
233 233
         //Check if password if everything was correct, then save it to User and DB
234
-        if ($pw_form->isSubmitted() && $pw_form->isValid() && ! $this->demo_mode) {
234
+        if ($pw_form->isSubmitted() && $pw_form->isValid() && !$this->demo_mode) {
235 235
             $password = $passwordEncoder->encodePassword($user, $pw_form['new_password']->getData());
236 236
             $user->setPassword($password);
237 237
 
@@ -246,14 +246,14 @@  discard block
 block discarded – undo
246 246
         //Handle 2FA things
247 247
         $google_form = $this->createForm(TFAGoogleSettingsType::class, $user);
248 248
         $google_enabled = $user->isGoogleAuthenticatorEnabled();
249
-        if (! $form->isSubmitted() && ! $google_enabled) {
249
+        if (!$form->isSubmitted() && !$google_enabled) {
250 250
             $user->setGoogleAuthenticatorSecret($googleAuthenticator->generateSecret());
251 251
             $google_form->get('googleAuthenticatorSecret')->setData($user->getGoogleAuthenticatorSecret());
252 252
         }
253 253
         $google_form->handleRequest($request);
254 254
 
255
-        if ($google_form->isSubmitted() && $google_form->isValid() && ! $this->demo_mode) {
256
-            if (! $google_enabled) {
255
+        if ($google_form->isSubmitted() && $google_form->isValid() && !$this->demo_mode) {
256
+            if (!$google_enabled) {
257 257
                 //Save 2FA settings (save secrets)
258 258
                 $user->setGoogleAuthenticatorSecret($google_form->get('googleAuthenticatorSecret')->getData());
259 259
                 $backupCodeManager->enableBackupCodes($user);
@@ -281,7 +281,7 @@  discard block
 block discarded – undo
281 281
         ])->getForm();
282 282
 
283 283
         $backup_form->handleRequest($request);
284
-        if ($backup_form->isSubmitted() && $backup_form->isValid() && ! $this->demo_mode) {
284
+        if ($backup_form->isSubmitted() && $backup_form->isValid() && !$this->demo_mode) {
285 285
             $backupCodeManager->regenerateBackupCodes($user);
286 286
             $em->flush();
287 287
             $this->addFlash('success', 'user.settings.2fa.backup_codes.regenerated');
Please login to merge, or discard this patch.
src/Controller/AdminPages/BaseAdminController.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
         $form->handleRequest($request);
84 84
         if ($form->isSubmitted() && $form->isValid()) {
85 85
             //Check if we editing a user and if we need to change the password of it
86
-            if ($entity instanceof User && ! empty($form['new_password']->getData())) {
86
+            if ($entity instanceof User && !empty($form['new_password']->getData())) {
87 87
                 $password = $this->passwordEncoder->encodePassword($entity, $form['new_password']->getData());
88 88
                 $entity->setPassword($password);
89 89
                 //By default the user must change the password afterwards
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
             //Rebuild form, so it is based on the updated data. Important for the parent field!
117 117
             //We can not use dynamic form events here, because the parent entity list is build from database!
118 118
             $form = $this->createForm($this->form_class, $entity, ['attachment_class' => $this->attachment_class]);
119
-        } elseif ($form->isSubmitted() && ! $form->isValid()) {
119
+        } elseif ($form->isSubmitted() && !$form->isValid()) {
120 120
             $this->addFlash('error', 'entity.edit_flash.invalid');
121 121
         }
122 122
 
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
         $form->handleRequest($request);
141 141
 
142 142
         if ($form->isSubmitted() && $form->isValid()) {
143
-            if ($new_entity instanceof User && ! empty($form['new_password']->getData())) {
143
+            if ($new_entity instanceof User && !empty($form['new_password']->getData())) {
144 144
                 $password = $this->passwordEncoder->encodePassword($new_entity, $form['new_password']->getData());
145 145
                 $new_entity->setPassword($password);
146 146
                 //By default the user must change the password afterwards
@@ -173,7 +173,7 @@  discard block
 block discarded – undo
173 173
             return $this->redirectToRoute($this->route_base.'_edit', ['id' => $new_entity->getID()]);
174 174
         }
175 175
 
176
-        if ($form->isSubmitted() && ! $form->isValid()) {
176
+        if ($form->isSubmitted() && !$form->isValid()) {
177 177
             $this->addFlash('error', 'entity.created_flash.invalid');
178 178
         }
179 179
 
Please login to merge, or discard this patch.
src/DataFixtures/DataStructureFixtures.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -70,7 +70,7 @@
 block discarded – undo
70 70
      */
71 71
     public function createNodesForClass(string $class, ObjectManager $manager): void
72 72
     {
73
-        if (! new $class() instanceof StructuralDBElement) {
73
+        if (!new $class() instanceof StructuralDBElement) {
74 74
             throw new \InvalidArgumentException('$class must be a StructuralDBElement!');
75 75
         }
76 76
 
Please login to merge, or discard this patch.
src/Helpers/Trees/StructuralDBElementIterator.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@
 block discarded – undo
38 38
         /** @var StructuralDBElement $element */
39 39
         $element = $this->current();
40 40
 
41
-        return ! empty($element->getSubelements());
41
+        return !empty($element->getSubelements());
42 42
     }
43 43
 
44 44
     public function getChildren()
Please login to merge, or discard this patch.