@@ -82,9 +82,9 @@ discard block |
||
| 82 | 82 | public function buildForm(FormBuilderInterface $builder, array $options): void |
| 83 | 83 | { |
| 84 | 84 | $builder->addModelTransformer(new CallbackTransformer( |
| 85 | - function ($value) use ($options) { |
|
| 85 | + function($value) use ($options) { |
|
| 86 | 86 | return $this->transform($value, $options); |
| 87 | - }, function ($value) use ($options) { |
|
| 87 | + }, function($value) use ($options) { |
|
| 88 | 88 | return $this->reverseTransform($value, $options); |
| 89 | 89 | })); |
| 90 | 90 | } |
@@ -94,21 +94,21 @@ discard block |
||
| 94 | 94 | $resolver->setRequired(['class']); |
| 95 | 95 | $resolver->setDefaults([ |
| 96 | 96 | 'show_fullpath_in_subtext' => true, //When this is enabled, the full path will be shown in subtext |
| 97 | - 'subentities_of' => null, //Only show entities with the given parent class |
|
| 98 | - 'disable_not_selectable' => false, //Disable entries with not selectable property |
|
| 97 | + 'subentities_of' => null, //Only show entities with the given parent class |
|
| 98 | + 'disable_not_selectable' => false, //Disable entries with not selectable property |
|
| 99 | 99 | 'choice_value' => 'id', //Use the element id as option value and for comparing items |
| 100 | - 'choice_loader' => function (Options $options) { |
|
| 101 | - return new CallbackChoiceLoader(function () use ($options) { |
|
| 100 | + 'choice_loader' => function(Options $options) { |
|
| 101 | + return new CallbackChoiceLoader(function() use ($options) { |
|
| 102 | 102 | return $this->getEntries($options); |
| 103 | 103 | }); |
| 104 | 104 | }, |
| 105 | - 'choice_label' => function (Options $options) { |
|
| 106 | - return function ($choice, $key, $value) use ($options) { |
|
| 105 | + 'choice_label' => function(Options $options) { |
|
| 106 | + return function($choice, $key, $value) use ($options) { |
|
| 107 | 107 | return $this->generateChoiceLabels($choice, $key, $value, $options); |
| 108 | 108 | }; |
| 109 | 109 | }, |
| 110 | - 'choice_attr' => function (Options $options) { |
|
| 111 | - return function ($choice, $key, $value) use ($options) { |
|
| 110 | + 'choice_attr' => function(Options $options) { |
|
| 111 | + return function($choice, $key, $value) use ($options) { |
|
| 112 | 112 | return $this->generateChoiceAttr($choice, $key, $value, $options); |
| 113 | 113 | }; |
| 114 | 114 | }, |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | |
| 118 | 118 | $resolver->setDefault('empty_message', null); |
| 119 | 119 | |
| 120 | - $resolver->setDefault('attr', function (Options $options) { |
|
| 120 | + $resolver->setDefault('attr', function(Options $options) { |
|
| 121 | 121 | $tmp = [ |
| 122 | 122 | 'class' => 'selectpicker', |
| 123 | 123 | 'data-live-search' => true, |
@@ -49,7 +49,7 @@ |
||
| 49 | 49 | $throwable = $throwable->getPrevious(); |
| 50 | 50 | } |
| 51 | 51 | //Ignore everything except AccessDeniedExceptions |
| 52 | - if (! $throwable instanceof AccessDeniedException) { |
|
| 52 | + if (!$throwable instanceof AccessDeniedException) { |
|
| 53 | 53 | return; |
| 54 | 54 | } |
| 55 | 55 | |
@@ -102,8 +102,8 @@ discard block |
||
| 102 | 102 | $optionsResolver->setAllowedTypes('filter_elements', ['array', 'object']); |
| 103 | 103 | $optionsResolver->setAllowedTypes('mode', 'string'); |
| 104 | 104 | |
| 105 | - $optionsResolver->setNormalizer('filter_elements', function (Options $options, $value) { |
|
| 106 | - if (! is_array($value)) { |
|
| 105 | + $optionsResolver->setNormalizer('filter_elements', function(Options $options, $value) { |
|
| 106 | + if (!is_array($value)) { |
|
| 107 | 107 | return [$value]; |
| 108 | 108 | } |
| 109 | 109 | |
@@ -121,7 +121,7 @@ discard block |
||
| 121 | 121 | |
| 122 | 122 | $dataTable->add('symbol', TextColumn::class, [ |
| 123 | 123 | 'label' => '', |
| 124 | - 'render' => function ($value, AbstractLogEntry $context) { |
|
| 124 | + 'render' => function($value, AbstractLogEntry $context) { |
|
| 125 | 125 | switch ($context->getLevelString()) { |
| 126 | 126 | case LogLevel::DEBUG: |
| 127 | 127 | $symbol = 'fa-bug'; |
@@ -182,7 +182,7 @@ discard block |
||
| 182 | 182 | $dataTable->add('type', TextColumn::class, [ |
| 183 | 183 | 'label' => $this->translator->trans('log.type'), |
| 184 | 184 | 'propertyPath' => 'type', |
| 185 | - 'render' => function (string $value, AbstractLogEntry $context) { |
|
| 185 | + 'render' => function(string $value, AbstractLogEntry $context) { |
|
| 186 | 186 | return $this->translator->trans('log.type.'.$value); |
| 187 | 187 | }, |
| 188 | 188 | ]); |
@@ -191,14 +191,14 @@ discard block |
||
| 191 | 191 | 'label' => $this->translator->trans('log.level'), |
| 192 | 192 | 'visible' => 'system_log' === $options['mode'], |
| 193 | 193 | 'propertyPath' => 'levelString', |
| 194 | - 'render' => function (string $value, AbstractLogEntry $context) { |
|
| 194 | + 'render' => function(string $value, AbstractLogEntry $context) { |
|
| 195 | 195 | return $value; |
| 196 | 196 | }, |
| 197 | 197 | ]); |
| 198 | 198 | |
| 199 | 199 | $dataTable->add('user', TextColumn::class, [ |
| 200 | 200 | 'label' => $this->translator->trans('log.user'), |
| 201 | - 'render' => function ($value, AbstractLogEntry $context) { |
|
| 201 | + 'render' => function($value, AbstractLogEntry $context) { |
|
| 202 | 202 | $user = $context->getUser(); |
| 203 | 203 | |
| 204 | 204 | return sprintf( |
@@ -212,7 +212,7 @@ discard block |
||
| 212 | 212 | $dataTable->add('target_type', TextColumn::class, [ |
| 213 | 213 | 'label' => $this->translator->trans('log.target_type'), |
| 214 | 214 | 'visible' => false, |
| 215 | - 'render' => function ($value, AbstractLogEntry $context) { |
|
| 215 | + 'render' => function($value, AbstractLogEntry $context) { |
|
| 216 | 216 | $class = $context->getTargetClass(); |
| 217 | 217 | if (null !== $class) { |
| 218 | 218 | return $this->elementTypeNameGenerator->getLocalizedTypeLabel($class); |
@@ -234,7 +234,7 @@ discard block |
||
| 234 | 234 | $dataTable->add('timeTravel', IconLinkColumn::class, [ |
| 235 | 235 | 'label' => '', |
| 236 | 236 | 'icon' => 'fas fa-fw fa-eye', |
| 237 | - 'href' => function ($value, AbstractLogEntry $context) { |
|
| 237 | + 'href' => function($value, AbstractLogEntry $context) { |
|
| 238 | 238 | if ( |
| 239 | 239 | ($context instanceof TimeTravelInterface |
| 240 | 240 | && $context->hasOldDataInformations()) |
@@ -252,10 +252,10 @@ discard block |
||
| 252 | 252 | |
| 253 | 253 | return null; |
| 254 | 254 | }, |
| 255 | - 'disabled' => function ($value, AbstractLogEntry $context) { |
|
| 255 | + 'disabled' => function($value, AbstractLogEntry $context) { |
|
| 256 | 256 | return |
| 257 | - ! $this->security->isGranted('@tools.timetravel') |
|
| 258 | - || ! $this->security->isGranted('show_history', $context->getTargetClass()); |
|
| 257 | + !$this->security->isGranted('@tools.timetravel') |
|
| 258 | + || !$this->security->isGranted('show_history', $context->getTargetClass()); |
|
| 259 | 259 | }, |
| 260 | 260 | ]); |
| 261 | 261 | |
@@ -267,7 +267,7 @@ discard block |
||
| 267 | 267 | |
| 268 | 268 | $dataTable->createAdapter(ORMAdapter::class, [ |
| 269 | 269 | 'entity' => AbstractLogEntry::class, |
| 270 | - 'query' => function (QueryBuilder $builder) use ($options): void { |
|
| 270 | + 'query' => function(QueryBuilder $builder) use ($options): void { |
|
| 271 | 271 | $this->getQuery($builder, $options); |
| 272 | 272 | }, |
| 273 | 273 | ]); |
@@ -293,7 +293,7 @@ discard block |
||
| 293 | 293 | ]); |
| 294 | 294 | } |
| 295 | 295 | |
| 296 | - if (! empty($options['filter_elements'])) { |
|
| 296 | + if (!empty($options['filter_elements'])) { |
|
| 297 | 297 | foreach ($options['filter_elements'] as $element) { |
| 298 | 298 | /** @var AbstractDBElement $element */ |
| 299 | 299 | |
@@ -126,11 +126,11 @@ |
||
| 126 | 126 | */ |
| 127 | 127 | public function getThumbnailURL(Attachment $attachment, string $filter_name = 'thumbnail_sm'): string |
| 128 | 128 | { |
| 129 | - if (! $attachment->isPicture()) { |
|
| 129 | + if (!$attachment->isPicture()) { |
|
| 130 | 130 | throw new InvalidArgumentException('Thumbnail creation only works for picture attachments!'); |
| 131 | 131 | } |
| 132 | 132 | |
| 133 | - if ($attachment->isExternal() && ! empty($attachment->getURL())) { |
|
| 133 | + if ($attachment->isExternal() && !empty($attachment->getURL())) { |
|
| 134 | 134 | return $attachment->getURL(); |
| 135 | 135 | } |
| 136 | 136 | |
@@ -59,7 +59,7 @@ |
||
| 59 | 59 | |
| 60 | 60 | public function setTargetElement(?AbstractDBElement $element): AbstractLogEntry |
| 61 | 61 | { |
| 62 | - if (! $element instanceof User) { |
|
| 62 | + if (!$element instanceof User) { |
|
| 63 | 63 | throw new \InvalidArgumentException('Target element must be a User object!'); |
| 64 | 64 | } |
| 65 | 65 | |
@@ -508,7 +508,7 @@ discard block |
||
| 508 | 508 | { |
| 509 | 509 | $tmp = $this->getFirstName(); |
| 510 | 510 | //Dont add a space, if the name has only one part (it would look strange) |
| 511 | - if (! empty($this->getFirstName()) && ! empty($this->getLastName())) { |
|
| 511 | + if (!empty($this->getFirstName()) && !empty($this->getLastName())) { |
|
| 512 | 512 | $tmp .= ' '; |
| 513 | 513 | } |
| 514 | 514 | $tmp .= $this->getLastName(); |
@@ -530,7 +530,7 @@ discard block |
||
| 530 | 530 | public function setName(string $new_name): AbstractNamedDBElement |
| 531 | 531 | { |
| 532 | 532 | // Anonymous user is not allowed to change its username |
| 533 | - if (! $this->isAnonymousUser()) { |
|
| 533 | + if (!$this->isAnonymousUser()) { |
|
| 534 | 534 | $this->name = $new_name; |
| 535 | 535 | } |
| 536 | 536 | |
@@ -95,7 +95,7 @@ |
||
| 95 | 95 | * |
| 96 | 96 | * @return Response |
| 97 | 97 | */ |
| 98 | - public function new(Request $request, EntityManagerInterface $em, EntityImporter $importer, ?AttachmentType $entity = null): Response |
|
| 98 | + public function new(Request $request, EntityManagerInterface $em, EntityImporter $importer, ?AttachmentType $entity = null) : Response |
|
| 99 | 99 | { |
| 100 | 100 | return $this->_new($request, $em, $importer, $entity); |
| 101 | 101 | } |
@@ -65,7 +65,7 @@ |
||
| 65 | 65 | public function replace(string $lines, object $target): string |
| 66 | 66 | { |
| 67 | 67 | $patterns = [ |
| 68 | - '/(\[\[[A-Z_]+\]\])/' => function ($match) use ($target) { |
|
| 68 | + '/(\[\[[A-Z_]+\]\])/' => function($match) use ($target) { |
|
| 69 | 69 | return $this->handlePlaceholder($match[0], $target); |
| 70 | 70 | }, |
| 71 | 71 | ]; |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | 'attr' => [ |
| 96 | 96 | 'placeholder' => 'user.username.placeholder', |
| 97 | 97 | ], |
| 98 | - 'disabled' => ! $this->security->isGranted('edit_username', $entity), |
|
| 98 | + 'disabled' => !$this->security->isGranted('edit_username', $entity), |
|
| 99 | 99 | ]) |
| 100 | 100 | |
| 101 | 101 | ->add('group', StructuralEntityType::class, [ |
@@ -103,7 +103,7 @@ discard block |
||
| 103 | 103 | 'required' => false, |
| 104 | 104 | 'label' => 'group.label', |
| 105 | 105 | 'disable_not_selectable' => true, |
| 106 | - 'disabled' => ! $this->security->isGranted('change_group', $entity), |
|
| 106 | + 'disabled' => !$this->security->isGranted('change_group', $entity), |
|
| 107 | 107 | ]) |
| 108 | 108 | |
| 109 | 109 | ->add('first_name', TextType::class, [ |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | 'placeholder' => 'user.firstName.placeholder', |
| 114 | 114 | ], |
| 115 | 115 | 'required' => false, |
| 116 | - 'disabled' => ! $this->security->isGranted('edit_infos', $entity), |
|
| 116 | + 'disabled' => !$this->security->isGranted('edit_infos', $entity), |
|
| 117 | 117 | ]) |
| 118 | 118 | |
| 119 | 119 | ->add('last_name', TextType::class, [ |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | 'placeholder' => 'user.lastName.placeholder', |
| 124 | 124 | ], |
| 125 | 125 | 'required' => false, |
| 126 | - 'disabled' => ! $this->security->isGranted('edit_infos', $entity), |
|
| 126 | + 'disabled' => !$this->security->isGranted('edit_infos', $entity), |
|
| 127 | 127 | ]) |
| 128 | 128 | |
| 129 | 129 | ->add('email', TextType::class, [ |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | 'placeholder' => 'user.email.placeholder', |
| 134 | 134 | ], |
| 135 | 135 | 'required' => false, |
| 136 | - 'disabled' => ! $this->security->isGranted('edit_infos', $entity), |
|
| 136 | + 'disabled' => !$this->security->isGranted('edit_infos', $entity), |
|
| 137 | 137 | ]) |
| 138 | 138 | |
| 139 | 139 | ->add('department', TextType::class, [ |
@@ -143,7 +143,7 @@ discard block |
||
| 143 | 143 | 'placeholder' => 'user.department.placeholder', |
| 144 | 144 | ], |
| 145 | 145 | 'required' => false, |
| 146 | - 'disabled' => ! $this->security->isGranted('edit_infos', $entity), |
|
| 146 | + 'disabled' => !$this->security->isGranted('edit_infos', $entity), |
|
| 147 | 147 | ]) |
| 148 | 148 | |
| 149 | 149 | //Config section |
@@ -156,7 +156,7 @@ discard block |
||
| 156 | 156 | 'placeholder' => 'user_settings.language.placeholder', |
| 157 | 157 | 'label' => 'user.language_select', |
| 158 | 158 | 'preferred_choices' => ['en', 'de'], |
| 159 | - 'disabled' => ! $this->security->isGranted('change_user_settings', $entity), |
|
| 159 | + 'disabled' => !$this->security->isGranted('change_user_settings', $entity), |
|
| 160 | 160 | ]) |
| 161 | 161 | ->add('timezone', TimezoneType::class, [ |
| 162 | 162 | 'required' => false, |
@@ -167,12 +167,12 @@ discard block |
||
| 167 | 167 | 'placeholder' => 'user_settings.timezone.placeholder', |
| 168 | 168 | 'label' => 'user.timezone.label', |
| 169 | 169 | 'preferred_choices' => ['Europe/Berlin'], |
| 170 | - 'disabled' => ! $this->security->isGranted('change_user_settings', $entity), |
|
| 170 | + 'disabled' => !$this->security->isGranted('change_user_settings', $entity), |
|
| 171 | 171 | ]) |
| 172 | 172 | ->add('theme', ChoiceType::class, [ |
| 173 | 173 | 'required' => false, |
| 174 | 174 | 'choices' => User::AVAILABLE_THEMES, |
| 175 | - 'choice_label' => function ($entity, $key, $value) { |
|
| 175 | + 'choice_label' => function($entity, $key, $value) { |
|
| 176 | 176 | return $value; |
| 177 | 177 | }, |
| 178 | 178 | 'attr' => [ |
@@ -181,12 +181,12 @@ discard block |
||
| 181 | 181 | 'choice_translation_domain' => false, |
| 182 | 182 | 'placeholder' => 'user_settings.theme.placeholder', |
| 183 | 183 | 'label' => 'user.theme.label', |
| 184 | - 'disabled' => ! $this->security->isGranted('change_user_settings', $entity), |
|
| 184 | + 'disabled' => !$this->security->isGranted('change_user_settings', $entity), |
|
| 185 | 185 | ]) |
| 186 | 186 | ->add('currency', CurrencyEntityType::class, [ |
| 187 | 187 | 'required' => false, |
| 188 | 188 | 'label' => 'user.currency.label', |
| 189 | - 'disabled' => ! $this->security->isGranted('change_user_settings', $entity), |
|
| 189 | + 'disabled' => !$this->security->isGranted('change_user_settings', $entity), |
|
| 190 | 190 | ]) |
| 191 | 191 | |
| 192 | 192 | ->add('new_password', RepeatedType::class, [ |
@@ -200,7 +200,7 @@ discard block |
||
| 200 | 200 | 'invalid_message' => 'password_must_match', |
| 201 | 201 | 'required' => false, |
| 202 | 202 | 'mapped' => false, |
| 203 | - 'disabled' => ! $this->security->isGranted('set_password', $entity), |
|
| 203 | + 'disabled' => !$this->security->isGranted('set_password', $entity), |
|
| 204 | 204 | 'constraints' => [new Length([ |
| 205 | 205 | 'min' => 6, |
| 206 | 206 | 'max' => 128, |
@@ -213,7 +213,7 @@ discard block |
||
| 213 | 213 | 'class' => 'checkbox-custom', |
| 214 | 214 | ], |
| 215 | 215 | 'label' => 'user.edit.needs_pw_change', |
| 216 | - 'disabled' => ! $this->security->isGranted('set_password', $entity), |
|
| 216 | + 'disabled' => !$this->security->isGranted('set_password', $entity), |
|
| 217 | 217 | ]) |
| 218 | 218 | |
| 219 | 219 | ->add('disabled', CheckboxType::class, [ |
@@ -222,7 +222,7 @@ discard block |
||
| 222 | 222 | 'class' => 'checkbox-custom', |
| 223 | 223 | ], |
| 224 | 224 | 'label' => 'user.edit.user_disabled', |
| 225 | - 'disabled' => ! $this->security->isGranted('set_password', $entity) |
|
| 225 | + 'disabled' => !$this->security->isGranted('set_password', $entity) |
|
| 226 | 226 | || $entity === $this->security->getUser(), |
| 227 | 227 | ]) |
| 228 | 228 | |
@@ -230,7 +230,7 @@ discard block |
||
| 230 | 230 | ->add('permissions', PermissionsType::class, [ |
| 231 | 231 | 'mapped' => false, |
| 232 | 232 | 'data' => $builder->getData(), |
| 233 | - 'disabled' => ! $this->security->isGranted('edit_permissions', $entity), |
|
| 233 | + 'disabled' => !$this->security->isGranted('edit_permissions', $entity), |
|
| 234 | 234 | ]) |
| 235 | 235 | ; |
| 236 | 236 | /*->add('comment', CKEditorType::class, ['required' => false, |
@@ -250,7 +250,7 @@ discard block |
||
| 250 | 250 | 'data_class' => $options['attachment_class'], |
| 251 | 251 | ], |
| 252 | 252 | 'by_reference' => false, |
| 253 | - 'disabled' => ! $this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
|
| 253 | + 'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
|
| 254 | 254 | ]); |
| 255 | 255 | |
| 256 | 256 | $builder->add('log_comment', TextType::class, [ |