@@ -381,7 +381,7 @@ |
||
381 | 381 | $class = get_class($entity); |
382 | 382 | |
383 | 383 | //Check if we have an direct mapping for the given class |
384 | - if (! array_key_exists($class, $map)) { |
|
384 | + if (!array_key_exists($class, $map)) { |
|
385 | 385 | //Check if we need to check inheritance by looping through our map |
386 | 386 | foreach (array_keys($map) as $key) { |
387 | 387 | if (is_a($entity, $key)) { |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | */ |
41 | 41 | public function extractParameters(string $input, string $class = PartParameter::class): array |
42 | 42 | { |
43 | - if (! is_a($class, AbstractParameter::class, true)) { |
|
43 | + if (!is_a($class, AbstractParameter::class, true)) { |
|
44 | 44 | throw new \InvalidArgumentException('$class must be a child class of AbstractParameter!'); |
45 | 45 | } |
46 | 46 | |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | |
69 | 69 | $matches = []; |
70 | 70 | \preg_match($regex, $input, $matches); |
71 | - if (! empty($matches)) { |
|
71 | + if (!empty($matches)) { |
|
72 | 72 | [, $name, $value] = $matches; |
73 | 73 | $value = trim($value); |
74 | 74 |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | $client->request('GET', static::$base_path.'/new'); |
91 | 91 | $this->assertFalse($client->getResponse()->isRedirect()); |
92 | 92 | $this->assertSame($read, $client->getResponse()->isSuccessful(), 'Controller was not successful!'); |
93 | - $this->assertSame($read, ! $client->getResponse()->isForbidden(), 'Permission Checking not working!'); |
|
93 | + $this->assertSame($read, !$client->getResponse()->isForbidden(), 'Permission Checking not working!'); |
|
94 | 94 | } |
95 | 95 | |
96 | 96 | /** |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | $client->request('GET', static::$base_path.'/1'); |
116 | 116 | $this->assertFalse($client->getResponse()->isRedirect()); |
117 | 117 | $this->assertSame($read, $client->getResponse()->isSuccessful(), 'Controller was not successful!'); |
118 | - $this->assertSame($read, ! $client->getResponse()->isForbidden(), 'Permission Checking not working!'); |
|
118 | + $this->assertSame($read, !$client->getResponse()->isForbidden(), 'Permission Checking not working!'); |
|
119 | 119 | } |
120 | 120 | |
121 | 121 | public function deleteDataProvider(): array |
@@ -152,6 +152,6 @@ discard block |
||
152 | 152 | |
153 | 153 | //Page is redirected to '/new', when delete was successful |
154 | 154 | $this->assertSame($delete, $client->getResponse()->isRedirect(static::$base_path.'/new')); |
155 | - $this->assertSame($delete, ! $client->getResponse()->isForbidden(), 'Permission Checking not working!'); |
|
155 | + $this->assertSame($delete, !$client->getResponse()->isForbidden(), 'Permission Checking not working!'); |
|
156 | 156 | } |
157 | 157 | } |
@@ -81,7 +81,7 @@ |
||
81 | 81 | |
82 | 82 | public function onKernelResponse(ResponseEvent $event): void |
83 | 83 | { |
84 | - if (! $this->kernel_debug) { |
|
84 | + if (!$this->kernel_debug) { |
|
85 | 85 | return; |
86 | 86 | } |
87 | 87 |
@@ -76,7 +76,7 @@ |
||
76 | 76 | } |
77 | 77 | |
78 | 78 | // if the user is anonymous, we use the anonymous user. |
79 | - if (! $user instanceof User) { |
|
79 | + if (!$user instanceof User) { |
|
80 | 80 | /** @var UserRepository $repo */ |
81 | 81 | $repo = $this->entityManager->getRepository(User::class); |
82 | 82 | $user = $repo->getAnonymousUser(); |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | $git = file($this->project_dir.'/.git/HEAD'); |
65 | 65 | $head = explode('/', $git[0], 3); |
66 | 66 | |
67 | - if (! isset($head[2])) { |
|
67 | + if (!isset($head[2])) { |
|
68 | 68 | return null; |
69 | 69 | } |
70 | 70 | |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | if (is_file($filename)) { |
90 | 90 | $head = file($filename); |
91 | 91 | |
92 | - if (! isset($head[0])) { |
|
92 | + if (!isset($head[0])) { |
|
93 | 93 | return null; |
94 | 94 | } |
95 | 95 |
@@ -93,14 +93,14 @@ discard block |
||
93 | 93 | 'attr' => [ |
94 | 94 | 'placeholder' => 'part.name.placeholder', |
95 | 95 | ], |
96 | - 'disabled' => ! $this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
|
96 | + 'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
|
97 | 97 | ]) |
98 | 98 | |
99 | 99 | ->add('parent', StructuralEntityType::class, [ |
100 | 100 | 'class' => get_class($entity), |
101 | 101 | 'required' => false, |
102 | 102 | 'label' => 'parent.label', |
103 | - 'disabled' => ! $this->security->isGranted($is_new ? 'create' : 'move', $entity), |
|
103 | + 'disabled' => !$this->security->isGranted($is_new ? 'create' : 'move', $entity), |
|
104 | 104 | ]) |
105 | 105 | |
106 | 106 | ->add('not_selectable', CheckboxType::class, [ |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | 'label_attr' => [ |
111 | 111 | 'class' => 'checkbox-custom', |
112 | 112 | ], |
113 | - 'disabled' => ! $this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
|
113 | + 'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
|
114 | 114 | ]) |
115 | 115 | |
116 | 116 | ->add('comment', CKEditorType::class, [ |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | 'rows' => 4, |
122 | 122 | ], |
123 | 123 | 'help' => 'bbcode.hint', |
124 | - 'disabled' => ! $this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
|
124 | + 'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
|
125 | 125 | ]); |
126 | 126 | |
127 | 127 | $this->additionalFormElements($builder, $options, $entity); |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | 'allow_delete' => true, |
134 | 134 | 'label' => false, |
135 | 135 | 'reindex_enable' => true, |
136 | - 'disabled' => ! $this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
|
136 | + 'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
|
137 | 137 | 'entry_options' => [ |
138 | 138 | 'data_class' => $options['attachment_class'], |
139 | 139 | ], |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | |
143 | 143 | $builder->add('master_picture_attachment', MasterPictureAttachmentType::class, [ |
144 | 144 | 'required' => false, |
145 | - 'disabled' => ! $this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
|
145 | + 'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
|
146 | 146 | 'label' => 'part.edit.master_attachment', |
147 | 147 | 'entity' => $entity, |
148 | 148 | ]); |
@@ -158,7 +158,7 @@ discard block |
||
158 | 158 | 'entry_type' => ParameterType::class, |
159 | 159 | 'allow_add' => $this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
160 | 160 | 'allow_delete' => $this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
161 | - 'disabled' => ! $this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
|
161 | + 'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
|
162 | 162 | 'reindex_enable' => true, |
163 | 163 | 'label' => false, |
164 | 164 | 'by_reference' => false, |
@@ -174,11 +174,11 @@ discard block |
||
174 | 174 | 'attr' => [ |
175 | 175 | 'class' => $is_new ? 'btn-success' : '', |
176 | 176 | ], |
177 | - 'disabled' => ! $this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
|
177 | + 'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
|
178 | 178 | ]) |
179 | 179 | ->add('reset', ResetType::class, [ |
180 | 180 | 'label' => 'entity.edit.reset', |
181 | - 'disabled' => ! $this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
|
181 | + 'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
|
182 | 182 | ]); |
183 | 183 | } |
184 | 184 |
@@ -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 |