@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | */ |
| 44 | 44 | public function validate($value, Constraint $constraint): void |
| 45 | 45 | { |
| 46 | - if (! $constraint instanceof Selectable) { |
|
| 46 | + if (!$constraint instanceof Selectable) { |
|
| 47 | 47 | throw new UnexpectedTypeException($constraint, Selectable::class); |
| 48 | 48 | } |
| 49 | 49 | |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | //Check type of value. Validating only works for StructuralDBElements |
| 57 | - if (! $value instanceof StructuralDBElement) { |
|
| 57 | + if (!$value instanceof StructuralDBElement) { |
|
| 58 | 58 | throw new UnexpectedValueException($value, 'StructuralDBElement'); |
| 59 | 59 | } |
| 60 | 60 | |
@@ -60,7 +60,7 @@ |
||
| 60 | 60 | public function onRegister(RegisterEvent $event): void |
| 61 | 61 | { |
| 62 | 62 | //Skip adding of U2F key on demo mode |
| 63 | - if (! $this->demo_mode) { |
|
| 63 | + if (!$this->demo_mode) { |
|
| 64 | 64 | $user = $event->getUser(); |
| 65 | 65 | $registration = $event->getRegistration(); |
| 66 | 66 | $newKey = new U2FKey(); |
@@ -62,7 +62,7 @@ |
||
| 62 | 62 | |
| 63 | 63 | public function onKernelResponse(FilterResponseEvent $event): void |
| 64 | 64 | { |
| 65 | - if (! $this->kernel->getParameter('kernel.debug')) { |
|
| 65 | + if (!$this->kernel->getParameter('kernel.debug')) { |
|
| 66 | 66 | return; |
| 67 | 67 | } |
| 68 | 68 | |
@@ -50,12 +50,12 @@ |
||
| 50 | 50 | |
| 51 | 51 | //Check if the user has set a timezone |
| 52 | 52 | $user = $this->security->getUser(); |
| 53 | - if ($user instanceof User && ! empty($user->getTimezone())) { |
|
| 53 | + if ($user instanceof User && !empty($user->getTimezone())) { |
|
| 54 | 54 | $timezone = $user->getTimezone(); |
| 55 | 55 | } |
| 56 | 56 | |
| 57 | 57 | //Fill with default value if needed |
| 58 | - if (null === $timezone && ! empty($this->default_timezone)) { |
|
| 58 | + if (null === $timezone && !empty($this->default_timezone)) { |
|
| 59 | 59 | $timezone = $this->default_timezone; |
| 60 | 60 | } |
| 61 | 61 | |
@@ -74,15 +74,15 @@ discard block |
||
| 74 | 74 | $user = $this->security->getUser(); |
| 75 | 75 | $request = $event->getRequest(); |
| 76 | 76 | |
| 77 | - if (! $event->isMasterRequest()) { |
|
| 77 | + if (!$event->isMasterRequest()) { |
|
| 78 | 78 | return; |
| 79 | 79 | } |
| 80 | - if (! $user instanceof User) { |
|
| 80 | + if (!$user instanceof User) { |
|
| 81 | 81 | return; |
| 82 | 82 | } |
| 83 | 83 | |
| 84 | 84 | //Abort if we dont need to redirect the user. |
| 85 | - if (! $user->isNeedPwChange() && ! static::TFARedirectNeeded($user)) { |
|
| 85 | + if (!$user->isNeedPwChange() && !static::TFARedirectNeeded($user)) { |
|
| 86 | 86 | return; |
| 87 | 87 | } |
| 88 | 88 | |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | { |
| 126 | 126 | $tfa_enabled = $user->isU2FAuthEnabled() || $user->isGoogleAuthenticatorEnabled(); |
| 127 | 127 | |
| 128 | - if (null !== $user->getGroup() && $user->getGroup()->isEnforce2FA() && ! $tfa_enabled) { |
|
| 128 | + if (null !== $user->getGroup() && $user->getGroup()->isEnforce2FA() && !$tfa_enabled) { |
|
| 129 | 129 | return true; |
| 130 | 130 | } |
| 131 | 131 | |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | $dataTable |
| 80 | 80 | ->add('picture', TextColumn::class, [ |
| 81 | 81 | 'label' => '', |
| 82 | - 'render' => function ($value, Part $context) { |
|
| 82 | + 'render' => function($value, Part $context) { |
|
| 83 | 83 | $preview_attachment = $this->previewGenerator->getTablePreviewAttachment($context); |
| 84 | 84 | if (null === $preview_attachment) { |
| 85 | 85 | return ''; |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | ]) |
| 97 | 97 | ->add('name', TextColumn::class, [ |
| 98 | 98 | 'label' => $this->translator->trans('part.table.name'), |
| 99 | - 'render' => function ($value, Part $context) { |
|
| 99 | + 'render' => function($value, Part $context) { |
|
| 100 | 100 | return sprintf( |
| 101 | 101 | '<a href="%s">%s</a>', |
| 102 | 102 | $this->urlGenerator->infoURL($context), |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | ]) |
| 126 | 126 | ->add('storelocation', TextColumn::class, [ |
| 127 | 127 | 'label' => $this->translator->trans('part.table.storeLocations'), |
| 128 | - 'render' => function ($value, Part $context) { |
|
| 128 | + 'render' => function($value, Part $context) { |
|
| 129 | 129 | $tmp = []; |
| 130 | 130 | foreach ($context->getPartLots() as $lot) { |
| 131 | 131 | //Ignore lots without storelocation |
@@ -144,7 +144,7 @@ discard block |
||
| 144 | 144 | ]) |
| 145 | 145 | ->add('amount', TextColumn::class, [ |
| 146 | 146 | 'label' => $this->translator->trans('part.table.amount'), |
| 147 | - 'render' => function ($value, Part $context) { |
|
| 147 | + 'render' => function($value, Part $context) { |
|
| 148 | 148 | $amount = $context->getAmountSum(); |
| 149 | 149 | |
| 150 | 150 | return $this->amountFormatter->format($amount, $context->getPartUnit()); |
@@ -153,7 +153,7 @@ discard block |
||
| 153 | 153 | ->add('minamount', TextColumn::class, [ |
| 154 | 154 | 'label' => $this->translator->trans('part.table.minamount'), |
| 155 | 155 | 'visible' => false, |
| 156 | - 'render' => function ($value, Part $context) { |
|
| 156 | + 'render' => function($value, Part $context) { |
|
| 157 | 157 | return $this->amountFormatter->format($value, $context->getPartUnit()); |
| 158 | 158 | }, |
| 159 | 159 | ]) |
@@ -216,12 +216,12 @@ discard block |
||
| 216 | 216 | |
| 217 | 217 | ->addOrderBy('name') |
| 218 | 218 | ->createAdapter(CustomORMAdapter::class, [ |
| 219 | - 'query' => function (QueryBuilder $builder): void { |
|
| 219 | + 'query' => function(QueryBuilder $builder): void { |
|
| 220 | 220 | $this->getQuery($builder); |
| 221 | 221 | }, |
| 222 | 222 | 'entity' => Part::class, |
| 223 | 223 | 'criteria' => [ |
| 224 | - function (QueryBuilder $builder) use ($options): void { |
|
| 224 | + function(QueryBuilder $builder) use ($options): void { |
|
| 225 | 225 | $this->buildCriteria($builder, $options); |
| 226 | 226 | }, |
| 227 | 227 | new SearchCriteriaProvider(), |
@@ -61,9 +61,9 @@ discard block |
||
| 61 | 61 | { |
| 62 | 62 | $dataTable->add('picture', TextColumn::class, [ |
| 63 | 63 | 'label' => '', |
| 64 | - 'render' => function ($value, Attachment $context) { |
|
| 64 | + 'render' => function($value, Attachment $context) { |
|
| 65 | 65 | if ($context->isPicture() |
| 66 | - && ! $context->isExternal() |
|
| 66 | + && !$context->isExternal() |
|
| 67 | 67 | && $this->attachmentHelper->isFileExisting($context)) { |
| 68 | 68 | return sprintf( |
| 69 | 69 | '<img alt="%s" src="%s" data-thumbnail="%s" class="%s">', |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | |
| 81 | 81 | $dataTable->add('name', TextColumn::class, [ |
| 82 | 82 | 'label' => 'attachment.edit.name', |
| 83 | - 'render' => function ($value, Attachment $context) { |
|
| 83 | + 'render' => function($value, Attachment $context) { |
|
| 84 | 84 | //Link to external source |
| 85 | 85 | if ($context->isExternal()) { |
| 86 | 86 | return sprintf( |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | $dataTable->add('attachment_type', TextColumn::class, [ |
| 106 | 106 | 'label' => 'attachment.table.type', |
| 107 | 107 | 'field' => 'attachment_type.name', |
| 108 | - 'render' => function ($value, Attachment $context) { |
|
| 108 | + 'render' => function($value, Attachment $context) { |
|
| 109 | 109 | return sprintf( |
| 110 | 110 | '<a href="%s">%s</a>', |
| 111 | 111 | $this->entityURLGenerator->editURL($context->getAttachmentType()), |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | $dataTable->add('element', TextColumn::class, [ |
| 118 | 118 | 'label' => 'attachment.table.element', |
| 119 | 119 | //'propertyPath' => 'element.name', |
| 120 | - 'render' => function ($value, Attachment $context) { |
|
| 120 | + 'render' => function($value, Attachment $context) { |
|
| 121 | 121 | return sprintf( |
| 122 | 122 | '<a href="%s">%s</a>', |
| 123 | 123 | $this->entityURLGenerator->infoURL($context->getElement()), |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | |
| 134 | 134 | $dataTable->add('filesize', TextColumn::class, [ |
| 135 | 135 | 'label' => $this->translator->trans('attachment.table.filesize'), |
| 136 | - 'render' => function ($value, Attachment $context) { |
|
| 136 | + 'render' => function($value, Attachment $context) { |
|
| 137 | 137 | if ($this->attachmentHelper->isFileExisting($context)) { |
| 138 | 138 | return $this->attachmentHelper->getHumanFileSize($context); |
| 139 | 139 | } |
@@ -197,7 +197,7 @@ discard block |
||
| 197 | 197 | |
| 198 | 198 | $dataTable->createAdapter(ORMAdapter::class, [ |
| 199 | 199 | 'entity' => Attachment::class, |
| 200 | - 'query' => function (QueryBuilder $builder): void { |
|
| 200 | + 'query' => function(QueryBuilder $builder): void { |
|
| 201 | 201 | $this->getQuery($builder); |
| 202 | 202 | }, |
| 203 | 203 | ]); |
@@ -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 (StructuralDBElement $element) use ($em): void { |
|
| 86 | + $this->execute($element, static function(StructuralDBElement $element) use ($em): void { |
|
| 87 | 87 | $em->remove($element); |
| 88 | 88 | }); |
| 89 | 89 | |
@@ -50,7 +50,7 @@ |
||
| 50 | 50 | */ |
| 51 | 51 | public function extract($resource, MessageCatalogue $catalogue): void |
| 52 | 52 | { |
| 53 | - if (! $this->finished) { |
|
| 53 | + if (!$this->finished) { |
|
| 54 | 54 | //Extract for every group... |
| 55 | 55 | foreach ($this->permission_structure['groups'] as $group) { |
| 56 | 56 | if (isset($group['label'])) { |