@@ -64,10 +64,10 @@ discard block |
||
64 | 64 | //Expand every line to a single entry: |
65 | 65 | $names = explode("\n", $lines); |
66 | 66 | |
67 | - if (! is_a($class_name, AbstractStructuralDBElement::class, true)) { |
|
67 | + if (!is_a($class_name, AbstractStructuralDBElement::class, true)) { |
|
68 | 68 | throw new InvalidArgumentException('$class_name must be a StructuralDBElement type!'); |
69 | 69 | } |
70 | - if (null !== $parent && ! is_a($parent, $class_name)) { |
|
70 | + if (null !== $parent && !is_a($parent, $class_name)) { |
|
71 | 71 | throw new InvalidArgumentException('$parent must have the same type as specified in $class_name!'); |
72 | 72 | } |
73 | 73 | |
@@ -184,7 +184,7 @@ discard block |
||
184 | 184 | ]); |
185 | 185 | |
186 | 186 | //Ensure we have an array of entitity elements. |
187 | - if (! is_array($entities)) { |
|
187 | + if (!is_array($entities)) { |
|
188 | 188 | $entities = [$entities]; |
189 | 189 | } |
190 | 190 |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | $children = $element->getChildren(); |
59 | 59 | |
60 | 60 | //If we should call from top we execute the func here. |
61 | - if (! $call_from_bottom) { |
|
61 | + if (!$call_from_bottom) { |
|
62 | 62 | $func($element); |
63 | 63 | } |
64 | 64 | |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | { |
84 | 84 | $em = $this->em; |
85 | 85 | |
86 | - $this->execute($element, static function (AbstractStructuralDBElement $element) use ($em): void { |
|
86 | + $this->execute($element, static function(AbstractStructuralDBElement $element) use ($em): void { |
|
87 | 87 | $em->remove($element); |
88 | 88 | }); |
89 | 89 |
@@ -71,7 +71,7 @@ |
||
71 | 71 | */ |
72 | 72 | public function createNodesForClass(string $class, ObjectManager $manager): void |
73 | 73 | { |
74 | - if (! new $class() instanceof AbstractStructuralDBElement) { |
|
74 | + if (!new $class() instanceof AbstractStructuralDBElement) { |
|
75 | 75 | throw new InvalidArgumentException('$class must be a StructuralDBElement!'); |
76 | 76 | } |
77 | 77 |
@@ -63,12 +63,12 @@ |
||
63 | 63 | |
64 | 64 | $resolver->setRequired('property'); |
65 | 65 | |
66 | - $resolver->setDefault('field', function (Options $option) { |
|
66 | + $resolver->setDefault('field', function(Options $option) { |
|
67 | 67 | return $option['property'].'.name'; |
68 | 68 | }); |
69 | 69 | |
70 | - $resolver->setDefault('render', function (Options $options) { |
|
71 | - return function ($value, Part $context) use ($options) { |
|
70 | + $resolver->setDefault('render', function(Options $options) { |
|
71 | + return function($value, Part $context) use ($options) { |
|
72 | 72 | /** @var AbstractDBElement|null $entity */ |
73 | 73 | $entity = $this->accessor->getValue($context, $options['property']); |
74 | 74 |
@@ -62,7 +62,7 @@ discard block |
||
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 |
||
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 |
||
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; |
@@ -85,7 +85,7 @@ |
||
85 | 85 | */ |
86 | 86 | protected function instanceToPermissionName($subject): ?string |
87 | 87 | { |
88 | - if (! is_string($subject)) { |
|
88 | + if (!is_string($subject)) { |
|
89 | 89 | $class_name = get_class($subject); |
90 | 90 | } else { |
91 | 91 | $class_name = $subject; |
@@ -66,7 +66,7 @@ |
||
66 | 66 | return ''; |
67 | 67 | } |
68 | 68 | |
69 | - $disabled = ! $this->security->isGranted('revert_element', $context->getTargetClass()); |
|
69 | + $disabled = !$this->security->isGranted('revert_element', $context->getTargetClass()); |
|
70 | 70 | |
71 | 71 | $tmp = '<div class="btn-group btn-group-sm">'; |
72 | 72 | $tmp .= sprintf( |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | //When user change its settings, he should be logged in fully. |
85 | 85 | $this->denyAccessUnlessGranted('IS_AUTHENTICATED_FULLY'); |
86 | 86 | |
87 | - if (! $user instanceof User) { |
|
87 | + if (!$user instanceof User) { |
|
88 | 88 | return new RuntimeException('This controller only works only for Part-DB User objects!'); |
89 | 89 | } |
90 | 90 | |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | //When user change its settings, he should be logged in fully. |
116 | 116 | $this->denyAccessUnlessGranted('IS_AUTHENTICATED_FULLY'); |
117 | 117 | |
118 | - if (! $user instanceof User) { |
|
118 | + if (!$user instanceof User) { |
|
119 | 119 | throw new RuntimeException('This controller only works only for Part-DB User objects!'); |
120 | 120 | } |
121 | 121 | |
@@ -166,7 +166,7 @@ discard block |
||
166 | 166 | //When user change its settings, he should be logged in fully. |
167 | 167 | $this->denyAccessUnlessGranted('IS_AUTHENTICATED_FULLY'); |
168 | 168 | |
169 | - if (! $user instanceof User) { |
|
169 | + if (!$user instanceof User) { |
|
170 | 170 | return new RuntimeException('This controller only works only for Part-DB User objects!'); |
171 | 171 | } |
172 | 172 | |
@@ -196,7 +196,7 @@ discard block |
||
196 | 196 | //When user change its settings, he should be logged in fully. |
197 | 197 | $this->denyAccessUnlessGranted('IS_AUTHENTICATED_FULLY'); |
198 | 198 | |
199 | - if (! $user instanceof User) { |
|
199 | + if (!$user instanceof User) { |
|
200 | 200 | throw new RuntimeException('This controller only works only for Part-DB User objects!'); |
201 | 201 | } |
202 | 202 | |
@@ -208,7 +208,7 @@ discard block |
||
208 | 208 | |
209 | 209 | $form->handleRequest($request); |
210 | 210 | |
211 | - if (! $this->demo_mode && $form->isSubmitted() && $form->isValid()) { |
|
211 | + if (!$this->demo_mode && $form->isSubmitted() && $form->isValid()) { |
|
212 | 212 | //Check if user theme setting has changed |
213 | 213 | if ($user->getTheme() !== $em->getUnitOfWork()->getOriginalEntityData($user)['theme']) { |
214 | 214 | $page_need_reload = true; |
@@ -268,7 +268,7 @@ discard block |
||
268 | 268 | $pw_form->handleRequest($request); |
269 | 269 | |
270 | 270 | //Check if password if everything was correct, then save it to User and DB |
271 | - if (! $this->demo_mode && $pw_form->isSubmitted() && $pw_form->isValid()) { |
|
271 | + if (!$this->demo_mode && $pw_form->isSubmitted() && $pw_form->isValid()) { |
|
272 | 272 | $password = $passwordEncoder->encodePassword($user, $pw_form['new_password']->getData()); |
273 | 273 | $user->setPassword($password); |
274 | 274 | |
@@ -283,14 +283,14 @@ discard block |
||
283 | 283 | //Handle 2FA things |
284 | 284 | $google_form = $this->createForm(TFAGoogleSettingsType::class, $user); |
285 | 285 | $google_enabled = $user->isGoogleAuthenticatorEnabled(); |
286 | - if (! $google_enabled && ! $form->isSubmitted()) { |
|
286 | + if (!$google_enabled && !$form->isSubmitted()) { |
|
287 | 287 | $user->setGoogleAuthenticatorSecret($googleAuthenticator->generateSecret()); |
288 | 288 | $google_form->get('googleAuthenticatorSecret')->setData($user->getGoogleAuthenticatorSecret()); |
289 | 289 | } |
290 | 290 | $google_form->handleRequest($request); |
291 | 291 | |
292 | - if (! $this->demo_mode && $google_form->isSubmitted() && $google_form->isValid()) { |
|
293 | - if (! $google_enabled) { |
|
292 | + if (!$this->demo_mode && $google_form->isSubmitted() && $google_form->isValid()) { |
|
293 | + if (!$google_enabled) { |
|
294 | 294 | //Save 2FA settings (save secrets) |
295 | 295 | $user->setGoogleAuthenticatorSecret($google_form->get('googleAuthenticatorSecret')->getData()); |
296 | 296 | $backupCodeManager->enableBackupCodes($user); |
@@ -318,7 +318,7 @@ discard block |
||
318 | 318 | ])->getForm(); |
319 | 319 | |
320 | 320 | $backup_form->handleRequest($request); |
321 | - if (! $this->demo_mode && $backup_form->isSubmitted() && $backup_form->isValid()) { |
|
321 | + if (!$this->demo_mode && $backup_form->isSubmitted() && $backup_form->isValid()) { |
|
322 | 322 | $backupCodeManager->regenerateBackupCodes($user); |
323 | 323 | $em->flush(); |
324 | 324 | $this->addFlash('success', 'user.settings.2fa.backup_codes.regenerated'); |
@@ -146,7 +146,7 @@ |
||
146 | 146 | $this->dbRepository->changeID($element, $logEntry->getTargetID()); |
147 | 147 | } |
148 | 148 | |
149 | - if (! $element instanceof AbstractDBElement) { |
|
149 | + if (!$element instanceof AbstractDBElement) { |
|
150 | 150 | $this->addFlash('error', 'log.undo.target_not_found'); |
151 | 151 | |
152 | 152 | return; |