@@ -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 |
@@ -59,11 +59,11 @@ |
||
59 | 59 | |
60 | 60 | public function render($value, $context) |
61 | 61 | { |
62 | - if (! $context instanceof Part) { |
|
62 | + if (!$context instanceof Part) { |
|
63 | 63 | throw new \RuntimeException('$context must be a Part object!'); |
64 | 64 | } |
65 | 65 | $tmp = ''; |
66 | - $attachments = $context->getAttachments()->filter(function (Attachment $attachment) { |
|
66 | + $attachments = $context->getAttachments()->filter(function(Attachment $attachment) { |
|
67 | 67 | return $attachment->getShowInTable() && $this->attachmentManager->isFileExisting($attachment); |
68 | 68 | }); |
69 | 69 |
@@ -38,7 +38,7 @@ |
||
38 | 38 | { |
39 | 39 | if (null === $value) { |
40 | 40 | return $this->options['nullValue']; |
41 | - } elseif (! $value instanceof \DateTimeInterface) { |
|
41 | + } elseif (!$value instanceof \DateTimeInterface) { |
|
42 | 42 | $value = new \DateTime((string) $value); |
43 | 43 | } |
44 | 44 |
@@ -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'])) { |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | */ |
156 | 156 | public function listOperationsForPermission(string $permission): array |
157 | 157 | { |
158 | - if (! $this->isValidPermission($permission)) { |
|
158 | + if (!$this->isValidPermission($permission)) { |
|
159 | 159 | throw new \InvalidArgumentException(sprintf('A permission with that name is not existing! Got %s.', $permission)); |
160 | 160 | } |
161 | 161 | $operations = $this->permission_structure['perms'][$permission]['operations']; |
@@ -194,7 +194,7 @@ discard block |
||
194 | 194 | $cache = new ConfigCache($this->cache_file, $this->is_debug); |
195 | 195 | |
196 | 196 | //Check if the cache is fresh, else regenerate it. |
197 | - if (! $cache->isFresh()) { |
|
197 | + if (!$cache->isFresh()) { |
|
198 | 198 | $permission_file = __DIR__.'/../../config/permissions.yaml'; |
199 | 199 | |
200 | 200 | //Read the permission config file... |