@@ -64,7 +64,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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'); |
@@ -83,7 +83,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
@@ -70,7 +70,7 @@ |
||
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 |
@@ -38,7 +38,7 @@ |
||
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() |
@@ -39,7 +39,7 @@ |
||
39 | 39 | /** @var TreeViewNode $element */ |
40 | 40 | $element = $this->current(); |
41 | 41 | |
42 | - return ! empty($element->getNodes()); |
|
42 | + return !empty($element->getNodes()); |
|
43 | 43 | } |
44 | 44 | |
45 | 45 | public function getChildren() |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | |
39 | 39 | public function convertToDatabaseValue($value, AbstractPlatform $platform) |
40 | 40 | { |
41 | - if (! self::$utc_timezone) { |
|
41 | + if (!self::$utc_timezone) { |
|
42 | 42 | self::$utc_timezone = new \DateTimeZone('UTC'); |
43 | 43 | } |
44 | 44 | |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | |
52 | 52 | public function convertToPHPValue($value, AbstractPlatform $platform) |
53 | 53 | { |
54 | - if (! self::$utc_timezone) { |
|
54 | + if (!self::$utc_timezone) { |
|
55 | 55 | self::$utc_timezone = new \DateTimeZone('UTC'); |
56 | 56 | } |
57 | 57 | |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | self::$utc_timezone |
66 | 66 | ); |
67 | 67 | |
68 | - if (! $converted) { |
|
68 | + if (!$converted) { |
|
69 | 69 | throw ConversionException::conversionFailedFormat($value, $this->getName(), $platform->getDateTimeFormatString()); |
70 | 70 | } |
71 | 71 |
@@ -53,7 +53,7 @@ |
||
53 | 53 | */ |
54 | 54 | public function checkPostAuth(UserInterface $user): void |
55 | 55 | { |
56 | - if (! $user instanceof User) { |
|
56 | + if (!$user instanceof User) { |
|
57 | 57 | return; |
58 | 58 | } |
59 | 59 |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | ); |
96 | 96 | |
97 | 97 | //Check if user is allowed to read info, otherwise apply placeholder |
98 | - if ((null !== $annotation) && ! $this->isGranted('read', $annotation, $element)) { |
|
98 | + if ((null !== $annotation) && !$this->isGranted('read', $annotation, $element)) { |
|
99 | 99 | $property->setAccessible(true); |
100 | 100 | $value = $annotation->getPlaceholder(); |
101 | 101 | |
@@ -143,8 +143,8 @@ discard block |
||
143 | 143 | $property->setAccessible(true); |
144 | 144 | |
145 | 145 | //If the user is not allowed to edit or read this property, reset all values. |
146 | - if ((! $this->isGranted('read', $annotation, $element) |
|
147 | - || ! $this->isGranted('edit', $annotation, $element))) { |
|
146 | + if ((!$this->isGranted('read', $annotation, $element) |
|
147 | + || !$this->isGranted('edit', $annotation, $element))) { |
|
148 | 148 | //Set value to old value, so that there a no change to this property |
149 | 149 | if (isset($old_data[$property->getName()])) { |
150 | 150 | $property->setValue($element, $old_data[$property->getName()]); |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | */ |
168 | 168 | protected function isRunningFromCLI() |
169 | 169 | { |
170 | - if (empty($_SERVER['REMOTE_ADDR']) && ! isset($_SERVER['HTTP_USER_AGENT']) && \count($_SERVER['argv']) > 0) { |
|
170 | + if (empty($_SERVER['REMOTE_ADDR']) && !isset($_SERVER['HTTP_USER_AGENT']) && \count($_SERVER['argv']) > 0) { |
|
171 | 171 | return true; |
172 | 172 | } |
173 | 173 | |
@@ -200,7 +200,7 @@ discard block |
||
200 | 200 | } |
201 | 201 | |
202 | 202 | //Check if we have already have saved the permission, otherwise save it to cache |
203 | - if (! isset($this->perm_cache[$mode][\get_class($element)][$operation])) { |
|
203 | + if (!isset($this->perm_cache[$mode][\get_class($element)][$operation])) { |
|
204 | 204 | $this->perm_cache[$mode][\get_class($element)][$operation] = $this->security->isGranted($operation, $element); |
205 | 205 | } |
206 | 206 |
@@ -58,7 +58,7 @@ |
||
58 | 58 | } |
59 | 59 | |
60 | 60 | // if the user is anonymous, we use the anonymous user. |
61 | - if (! $user instanceof User) { |
|
61 | + if (!$user instanceof User) { |
|
62 | 62 | $repo = $this->entityManager->getRepository(User::class); |
63 | 63 | $user = $repo->getAnonymousUser(); |
64 | 64 | if (null === $user) { |