@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | $this->addFlash('info', 'part.edited_flash'); |
184 | 184 | //Reload form, so the SIUnitType entries use the new part unit |
185 | 185 | $form = $this->createForm(PartBaseType::class, $part); |
186 | - } elseif ($form->isSubmitted() && ! $form->isValid()) { |
|
186 | + } elseif ($form->isSubmitted() && !$form->isValid()) { |
|
187 | 187 | $this->addFlash('error', 'part.edited_flash.invalid'); |
188 | 188 | } |
189 | 189 | |
@@ -227,7 +227,7 @@ discard block |
||
227 | 227 | * @return Response |
228 | 228 | */ |
229 | 229 | public function new(Request $request, EntityManagerInterface $em, TranslatorInterface $translator, |
230 | - AttachmentSubmitHandler $attachmentSubmitHandler, ?Part $part = null): Response |
|
230 | + AttachmentSubmitHandler $attachmentSubmitHandler, ?Part $part = null) : Response |
|
231 | 231 | { |
232 | 232 | if (null === $part) { |
233 | 233 | $new_part = new Part(); |
@@ -256,7 +256,7 @@ discard block |
||
256 | 256 | } |
257 | 257 | |
258 | 258 | $store_id = $request->get('storelocation', null); |
259 | - $storelocation = $store_id ? $em->find(Storelocation::class, $store_id): null; |
|
259 | + $storelocation = $store_id ? $em->find(Storelocation::class, $store_id) : null; |
|
260 | 260 | if (null !== $storelocation && $new_part->getPartLots()->isEmpty()) { |
261 | 261 | $partLot = new PartLot(); |
262 | 262 | $partLot->setStorageLocation($storelocation); |
@@ -265,7 +265,7 @@ discard block |
||
265 | 265 | } |
266 | 266 | |
267 | 267 | $supplier_id = $request->get('supplier', null); |
268 | - $supplier = $supplier_id ? $em->find(Supplier::class, $supplier_id): null; |
|
268 | + $supplier = $supplier_id ? $em->find(Supplier::class, $supplier_id) : null; |
|
269 | 269 | if (null !== $supplier && $new_part->getOrderdetails()->isEmpty()) { |
270 | 270 | $orderdetail = new Orderdetail(); |
271 | 271 | $orderdetail->setSupplier($supplier); |
@@ -306,7 +306,7 @@ discard block |
||
306 | 306 | return $this->redirectToRoute('part_edit', ['id' => $new_part->getID()]); |
307 | 307 | } |
308 | 308 | |
309 | - if ($form->isSubmitted() && ! $form->isValid()) { |
|
309 | + if ($form->isSubmitted() && !$form->isValid()) { |
|
310 | 310 | $this->addFlash('error', 'part.created_flash.invalid'); |
311 | 311 | } |
312 | 312 |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | */ |
101 | 101 | public function requestPwReset(PasswordResetManager $passwordReset, Request $request) |
102 | 102 | { |
103 | - if (! $this->allow_email_pw_reset) { |
|
103 | + if (!$this->allow_email_pw_reset) { |
|
104 | 104 | throw new AccessDeniedHttpException('The password reset via email is disabled!'); |
105 | 105 | } |
106 | 106 | |
@@ -144,7 +144,7 @@ discard block |
||
144 | 144 | */ |
145 | 145 | public function pwResetNewPw(PasswordResetManager $passwordReset, Request $request, EntityManagerInterface $em, EventDispatcherInterface $eventDispatcher, ?string $user = null, ?string $token = null) |
146 | 146 | { |
147 | - if (! $this->allow_email_pw_reset) { |
|
147 | + if (!$this->allow_email_pw_reset) { |
|
148 | 148 | throw new AccessDeniedHttpException('The password reset via email is disabled!'); |
149 | 149 | } |
150 | 150 | |
@@ -189,7 +189,7 @@ discard block |
||
189 | 189 | $data = $form->getData(); |
190 | 190 | //Try to set the new password |
191 | 191 | $success = $passwordReset->setNewPassword($data['username'], $data['token'], $data['new_password']); |
192 | - if (! $success) { |
|
192 | + if (!$success) { |
|
193 | 193 | $this->addFlash('error', 'pw_reset.new_pw.error'); |
194 | 194 | } else { |
195 | 195 | $this->addFlash('success', 'pw_reset.new_pw.success'); |
@@ -72,27 +72,27 @@ discard block |
||
72 | 72 | $builder |
73 | 73 | ->add('name', TextType::class, [ |
74 | 74 | 'label' => 'user.username.label', |
75 | - 'disabled' => ! $this->security->isGranted('edit_username', $options['data']) || $this->demo_mode, |
|
75 | + 'disabled' => !$this->security->isGranted('edit_username', $options['data']) || $this->demo_mode, |
|
76 | 76 | ]) |
77 | 77 | ->add('first_name', TextType::class, [ |
78 | 78 | 'required' => false, |
79 | 79 | 'label' => 'user.firstName.label', |
80 | - 'disabled' => ! $this->security->isGranted('edit_infos', $options['data']) || $this->demo_mode, |
|
80 | + 'disabled' => !$this->security->isGranted('edit_infos', $options['data']) || $this->demo_mode, |
|
81 | 81 | ]) |
82 | 82 | ->add('last_name', TextType::class, [ |
83 | 83 | 'required' => false, |
84 | 84 | 'label' => 'user.lastName.label', |
85 | - 'disabled' => ! $this->security->isGranted('edit_infos', $options['data']) || $this->demo_mode, |
|
85 | + 'disabled' => !$this->security->isGranted('edit_infos', $options['data']) || $this->demo_mode, |
|
86 | 86 | ]) |
87 | 87 | ->add('department', TextType::class, [ |
88 | 88 | 'required' => false, |
89 | 89 | 'label' => 'user.department.label', |
90 | - 'disabled' => ! $this->security->isGranted('edit_infos', $options['data']) || $this->demo_mode, |
|
90 | + 'disabled' => !$this->security->isGranted('edit_infos', $options['data']) || $this->demo_mode, |
|
91 | 91 | ]) |
92 | 92 | ->add('email', EmailType::class, [ |
93 | 93 | 'required' => false, |
94 | 94 | 'label' => 'user.email.label', |
95 | - 'disabled' => ! $this->security->isGranted('edit_infos', $options['data']) || $this->demo_mode, |
|
95 | + 'disabled' => !$this->security->isGranted('edit_infos', $options['data']) || $this->demo_mode, |
|
96 | 96 | ]) |
97 | 97 | ->add('language', LanguageType::class, [ |
98 | 98 | 'disabled' => $this->demo_mode, |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | ], |
125 | 125 | 'translation_domain' => false, |
126 | 126 | 'choices' => User::AVAILABLE_THEMES, |
127 | - 'choice_label' => function ($entity, $key, $value) { |
|
127 | + 'choice_label' => function($entity, $key, $value) { |
|
128 | 128 | return $value; |
129 | 129 | }, |
130 | 130 | 'placeholder' => 'user_settings.theme.placeholder', |
@@ -102,7 +102,7 @@ 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) { |
|
105 | + $optionsResolver->setNormalizer('filter_elements', function(Options $options, $value) { |
|
106 | 106 | if (!is_array($value)) { |
107 | 107 | return [$value]; |
108 | 108 | } |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | |
121 | 121 | $dataTable->add('symbol', TextColumn::class, [ |
122 | 122 | 'label' => '', |
123 | - 'render' => function ($value, AbstractLogEntry $context) { |
|
123 | + 'render' => function($value, AbstractLogEntry $context) { |
|
124 | 124 | switch ($context->getLevelString()) { |
125 | 125 | case LogLevel::DEBUG: |
126 | 126 | $symbol = 'fa-bug'; |
@@ -181,7 +181,7 @@ discard block |
||
181 | 181 | $dataTable->add('type', TextColumn::class, [ |
182 | 182 | 'label' => $this->translator->trans('log.type'), |
183 | 183 | 'propertyPath' => 'type', |
184 | - 'render' => function (string $value, AbstractLogEntry $context) { |
|
184 | + 'render' => function(string $value, AbstractLogEntry $context) { |
|
185 | 185 | return $this->translator->trans('log.type.'.$value); |
186 | 186 | }, |
187 | 187 | ]); |
@@ -190,14 +190,14 @@ discard block |
||
190 | 190 | 'label' => $this->translator->trans('log.level'), |
191 | 191 | 'visible' => 'system_log' === $options['mode'], |
192 | 192 | 'propertyPath' => 'levelString', |
193 | - 'render' => function (string $value, AbstractLogEntry $context) { |
|
193 | + 'render' => function(string $value, AbstractLogEntry $context) { |
|
194 | 194 | return $value; |
195 | 195 | }, |
196 | 196 | ]); |
197 | 197 | |
198 | 198 | $dataTable->add('user', TextColumn::class, [ |
199 | 199 | 'label' => $this->translator->trans('log.user'), |
200 | - 'render' => function ($value, AbstractLogEntry $context) { |
|
200 | + 'render' => function($value, AbstractLogEntry $context) { |
|
201 | 201 | $user = $context->getUser(); |
202 | 202 | |
203 | 203 | return sprintf( |
@@ -211,7 +211,7 @@ discard block |
||
211 | 211 | $dataTable->add('target_type', TextColumn::class, [ |
212 | 212 | 'label' => $this->translator->trans('log.target_type'), |
213 | 213 | 'visible' => false, |
214 | - 'render' => function ($value, AbstractLogEntry $context) { |
|
214 | + 'render' => function($value, AbstractLogEntry $context) { |
|
215 | 215 | $class = $context->getTargetClass(); |
216 | 216 | if (null !== $class) { |
217 | 217 | return $this->elementTypeNameGenerator->getLocalizedTypeLabel($class); |
@@ -233,7 +233,7 @@ discard block |
||
233 | 233 | $dataTable->add('timeTravel', IconLinkColumn::class, [ |
234 | 234 | 'label' => '', |
235 | 235 | 'icon' => 'fas fa-fw fa-eye', |
236 | - 'href' => function ($value, AbstractLogEntry $context) { |
|
236 | + 'href' => function($value, AbstractLogEntry $context) { |
|
237 | 237 | if ( |
238 | 238 | ($context instanceof TimeTravelInterface |
239 | 239 | && $context->hasOldDataInformations()) |
@@ -251,10 +251,10 @@ discard block |
||
251 | 251 | |
252 | 252 | return null; |
253 | 253 | }, |
254 | - 'disabled' => function ($value, AbstractLogEntry $context) { |
|
254 | + 'disabled' => function($value, AbstractLogEntry $context) { |
|
255 | 255 | return |
256 | - ! $this->security->isGranted('@tools.timetravel') |
|
257 | - || ! $this->security->isGranted('show_history', $context->getTargetClass()); |
|
256 | + !$this->security->isGranted('@tools.timetravel') |
|
257 | + || !$this->security->isGranted('show_history', $context->getTargetClass()); |
|
258 | 258 | }, |
259 | 259 | ]); |
260 | 260 | |
@@ -266,7 +266,7 @@ discard block |
||
266 | 266 | |
267 | 267 | $dataTable->createAdapter(ORMAdapter::class, [ |
268 | 268 | 'entity' => AbstractLogEntry::class, |
269 | - 'query' => function (QueryBuilder $builder) use ($options): void { |
|
269 | + 'query' => function(QueryBuilder $builder) use ($options): void { |
|
270 | 270 | $this->getQuery($builder, $options); |
271 | 271 | }, |
272 | 272 | ]); |
@@ -292,7 +292,7 @@ discard block |
||
292 | 292 | ]); |
293 | 293 | } |
294 | 294 | |
295 | - if (! empty($options['filter_elements'])) { |
|
295 | + if (!empty($options['filter_elements'])) { |
|
296 | 296 | foreach ($options['filter_elements'] as $element) { |
297 | 297 | /** @var AbstractDBElement $element */ |
298 | 298 |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | * |
122 | 122 | * @return Response |
123 | 123 | */ |
124 | - public function new(Request $request, EntityManagerInterface $em, EntityImporter $importer, ?User $entity = null): Response |
|
124 | + public function new(Request $request, EntityManagerInterface $em, EntityImporter $importer, ?User $entity = null) : Response |
|
125 | 125 | { |
126 | 126 | return $this->_new($request, $em, $importer, $entity); |
127 | 127 | } |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | //If no user id was passed, then we show info about the current user |
172 | 172 | if (null === $user) { |
173 | 173 | $tmp = $this->getUser(); |
174 | - if (! $tmp instanceof User) { |
|
174 | + if (!$tmp instanceof User) { |
|
175 | 175 | throw new InvalidArgumentException('Userinfo only works for database users!'); |
176 | 176 | } |
177 | 177 | $user = $tmp; |
@@ -97,7 +97,7 @@ |
||
97 | 97 | * |
98 | 98 | * @return Response |
99 | 99 | */ |
100 | - public function new(Request $request, EntityManagerInterface $em, EntityImporter $importer, ?Currency $entity = null): Response |
|
100 | + public function new(Request $request, EntityManagerInterface $em, EntityImporter $importer, ?Currency $entity = null) : Response |
|
101 | 101 | { |
102 | 102 | return $this->_new($request, $em, $importer, $entity); |
103 | 103 | } |
@@ -95,7 +95,7 @@ |
||
95 | 95 | * |
96 | 96 | * @return Response |
97 | 97 | */ |
98 | - public function new(Request $request, EntityManagerInterface $em, EntityImporter $importer, ?Category $entity = null): Response |
|
98 | + public function new(Request $request, EntityManagerInterface $em, EntityImporter $importer, ?Category $entity = null) : Response |
|
99 | 99 | { |
100 | 100 | return $this->_new($request, $em, $importer, $entity); |
101 | 101 | } |
@@ -95,7 +95,7 @@ |
||
95 | 95 | * |
96 | 96 | * @return Response |
97 | 97 | */ |
98 | - public function new(Request $request, EntityManagerInterface $em, EntityImporter $importer, ?MeasurementUnit $entity = null): Response |
|
98 | + public function new(Request $request, EntityManagerInterface $em, EntityImporter $importer, ?MeasurementUnit $entity = null) : Response |
|
99 | 99 | { |
100 | 100 | return $this->_new($request, $em, $importer, $entity); |
101 | 101 | } |
@@ -93,7 +93,7 @@ |
||
93 | 93 | * |
94 | 94 | * @return Response |
95 | 95 | */ |
96 | - public function new(Request $request, EntityManagerInterface $em, EntityImporter $importer, ?Storelocation $entity = null): Response |
|
96 | + public function new(Request $request, EntityManagerInterface $em, EntityImporter $importer, ?Storelocation $entity = null) : Response |
|
97 | 97 | { |
98 | 98 | return $this->_new($request, $em, $importer, $entity); |
99 | 99 | } |