@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | |
75 | 75 | public function buildForm(FormBuilderInterface $builder, array $options) |
76 | 76 | { |
77 | - $builder->addEventListener(FormEvents::PRE_SET_DATA, function (FormEvent $event) use ($options) { |
|
77 | + $builder->addEventListener(FormEvents::PRE_SET_DATA, function(FormEvent $event) use ($options) { |
|
78 | 78 | $data = $event->getData(); |
79 | 79 | $config = $event->getForm()->getConfig(); |
80 | 80 | //If enabled do a reindexing of the collection |
@@ -84,8 +84,8 @@ discard block |
||
84 | 84 | $error_mapping = []; |
85 | 85 | |
86 | 86 | foreach ($data->toArray() as $key => $item) { |
87 | - $index = $options['reindex_prefix'] . $this->propertyAccess->getValue($item, $options['reindex_path']); |
|
88 | - $error_mapping['[' . $key . ']'] = $index; |
|
87 | + $index = $options['reindex_prefix'].$this->propertyAccess->getValue($item, $options['reindex_path']); |
|
88 | + $error_mapping['['.$key.']'] = $index; |
|
89 | 89 | $reindexed_data->set($index, $item); |
90 | 90 | } |
91 | 91 | $event->setData($reindexed_data); |
@@ -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 |