@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | // This options allows you to override the currency shown for the null value |
| 73 | 73 | $resolver->setDefault('base_currency', null); |
| 74 | 74 | |
| 75 | - $resolver->setDefault('empty_message', function (Options $options) { |
|
| 75 | + $resolver->setDefault('empty_message', function(Options $options) { |
|
| 76 | 76 | //By default we use the global base currency: |
| 77 | 77 | $iso_code = $this->base_currency; |
| 78 | 78 | |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | { |
| 89 | 89 | //Similar to StructuralEntityType, but we use the currency symbol instead if available |
| 90 | 90 | |
| 91 | - if (! $choice instanceof Currency) { |
|
| 91 | + if (!$choice instanceof Currency) { |
|
| 92 | 92 | throw new \InvalidArgumentException('$choice must be an currency object!'); |
| 93 | 93 | } |
| 94 | 94 | |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | /** @var Currency $choice */ |
| 118 | 118 | $tmp = []; |
| 119 | 119 | |
| 120 | - if (! empty($choice->getIsoCode())) { |
|
| 120 | + if (!empty($choice->getIsoCode())) { |
|
| 121 | 121 | //Show the name of the currency |
| 122 | 122 | $tmp += ['data-subtext' => $choice->getName()]; |
| 123 | 123 | } |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | 'attr' => [ |
| 106 | 106 | 'placeholder' => 'part.edit.name.placeholder', |
| 107 | 107 | ], |
| 108 | - 'disabled' => ! $this->security->isGranted('name.edit', $part), |
|
| 108 | + 'disabled' => !$this->security->isGranted('name.edit', $part), |
|
| 109 | 109 | ]) |
| 110 | 110 | ->add('description', CKEditorType::class, [ |
| 111 | 111 | 'required' => false, |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | 'placeholder' => 'part.edit.description.placeholder', |
| 117 | 117 | 'rows' => 2, |
| 118 | 118 | ], |
| 119 | - 'disabled' => ! $this->security->isGranted('description.edit', $part), |
|
| 119 | + 'disabled' => !$this->security->isGranted('description.edit', $part), |
|
| 120 | 120 | ]) |
| 121 | 121 | ->add('minAmount', SIUnitType::class, [ |
| 122 | 122 | 'attr' => [ |
@@ -125,20 +125,20 @@ discard block |
||
| 125 | 125 | ], |
| 126 | 126 | 'label' => 'part.edit.mininstock', |
| 127 | 127 | 'measurement_unit' => $part->getPartUnit(), |
| 128 | - 'disabled' => ! $this->security->isGranted('minamount.edit', $part), |
|
| 128 | + 'disabled' => !$this->security->isGranted('minamount.edit', $part), |
|
| 129 | 129 | ]) |
| 130 | 130 | ->add('category', StructuralEntityType::class, [ |
| 131 | 131 | 'class' => Category::class, |
| 132 | 132 | 'label' => 'part.edit.category', |
| 133 | 133 | 'disable_not_selectable' => true, |
| 134 | - 'disabled' => ! $this->security->isGranted('category.edit', $part), |
|
| 134 | + 'disabled' => !$this->security->isGranted('category.edit', $part), |
|
| 135 | 135 | ]) |
| 136 | 136 | ->add('footprint', StructuralEntityType::class, [ |
| 137 | 137 | 'class' => Footprint::class, |
| 138 | 138 | 'required' => false, |
| 139 | 139 | 'label' => 'part.edit.footprint', |
| 140 | 140 | 'disable_not_selectable' => true, |
| 141 | - 'disabled' => ! $this->security->isGranted('footprint.edit', $part), |
|
| 141 | + 'disabled' => !$this->security->isGranted('footprint.edit', $part), |
|
| 142 | 142 | ]) |
| 143 | 143 | ->add('tags', TextType::class, [ |
| 144 | 144 | 'required' => false, |
@@ -148,7 +148,7 @@ discard block |
||
| 148 | 148 | 'class' => 'tagsinput', |
| 149 | 149 | 'data-autocomplete' => $this->urlGenerator->generate('typeahead_tags', ['query' => 'QUERY']), |
| 150 | 150 | ], |
| 151 | - 'disabled' => ! $this->security->isGranted('tags.edit', $part), |
|
| 151 | + 'disabled' => !$this->security->isGranted('tags.edit', $part), |
|
| 152 | 152 | ]); |
| 153 | 153 | |
| 154 | 154 | //Manufacturer section |
@@ -157,25 +157,25 @@ discard block |
||
| 157 | 157 | 'required' => false, |
| 158 | 158 | 'label' => 'part.edit.manufacturer.label', |
| 159 | 159 | 'disable_not_selectable' => true, |
| 160 | - 'disabled' => ! $this->security->isGranted('manufacturer.edit', $part), |
|
| 160 | + 'disabled' => !$this->security->isGranted('manufacturer.edit', $part), |
|
| 161 | 161 | ]) |
| 162 | 162 | ->add('manufacturer_product_url', UrlType::class, [ |
| 163 | 163 | 'required' => false, |
| 164 | 164 | 'empty_data' => '', |
| 165 | 165 | 'label' => 'part.edit.manufacturer_url.label', |
| 166 | - 'disabled' => ! $this->security->isGranted('mpn.edit', $part), |
|
| 166 | + 'disabled' => !$this->security->isGranted('mpn.edit', $part), |
|
| 167 | 167 | ]) |
| 168 | 168 | ->add('manufacturer_product_number', TextType::class, [ |
| 169 | 169 | 'required' => false, |
| 170 | 170 | 'empty_data' => '', |
| 171 | 171 | 'label' => 'part.edit.mpn', |
| 172 | - 'disabled' => ! $this->security->isGranted('mpn.edit', $part), |
|
| 172 | + 'disabled' => !$this->security->isGranted('mpn.edit', $part), |
|
| 173 | 173 | ]) |
| 174 | 174 | ->add('manufacturing_status', ChoiceType::class, [ |
| 175 | 175 | 'label' => 'part.edit.manufacturing_status', |
| 176 | 176 | 'choices' => $status_choices, |
| 177 | 177 | 'required' => false, |
| 178 | - 'disabled' => ! $this->security->isGranted('status.edit', $part), |
|
| 178 | + 'disabled' => !$this->security->isGranted('status.edit', $part), |
|
| 179 | 179 | ]); |
| 180 | 180 | |
| 181 | 181 | //Advanced section |
@@ -185,7 +185,7 @@ discard block |
||
| 185 | 185 | ], |
| 186 | 186 | 'required' => false, |
| 187 | 187 | 'label' => 'part.edit.needs_review', |
| 188 | - 'disabled' => ! $this->security->isGranted('edit', $part), |
|
| 188 | + 'disabled' => !$this->security->isGranted('edit', $part), |
|
| 189 | 189 | ]) |
| 190 | 190 | ->add('favorite', CheckboxType::class, [ |
| 191 | 191 | 'label_attr' => [ |
@@ -193,20 +193,20 @@ discard block |
||
| 193 | 193 | ], |
| 194 | 194 | 'required' => false, |
| 195 | 195 | 'label' => 'part.edit.is_favorite', |
| 196 | - 'disabled' => ! $this->security->isGranted('change_favorite', $part), |
|
| 196 | + 'disabled' => !$this->security->isGranted('change_favorite', $part), |
|
| 197 | 197 | ]) |
| 198 | 198 | ->add('mass', SIUnitType::class, [ |
| 199 | 199 | 'unit' => 'g', |
| 200 | 200 | 'label' => 'part.edit.mass', |
| 201 | 201 | 'required' => false, |
| 202 | - 'disabled' => ! $this->security->isGranted('mass.edit', $part), |
|
| 202 | + 'disabled' => !$this->security->isGranted('mass.edit', $part), |
|
| 203 | 203 | ]) |
| 204 | 204 | ->add('partUnit', StructuralEntityType::class, [ |
| 205 | 205 | 'class' => MeasurementUnit::class, |
| 206 | 206 | 'required' => false, |
| 207 | 207 | 'disable_not_selectable' => true, |
| 208 | 208 | 'label' => 'part.edit.partUnit', |
| 209 | - 'disabled' => ! $this->security->isGranted('unit.edit', $part), |
|
| 209 | + 'disabled' => !$this->security->isGranted('unit.edit', $part), |
|
| 210 | 210 | ]); |
| 211 | 211 | |
| 212 | 212 | //Comment section |
@@ -216,7 +216,7 @@ discard block |
||
| 216 | 216 | 'attr' => [ |
| 217 | 217 | 'rows' => 4, |
| 218 | 218 | ], |
| 219 | - 'disabled' => ! $this->security->isGranted('comment.edit', $part), |
|
| 219 | + 'disabled' => !$this->security->isGranted('comment.edit', $part), |
|
| 220 | 220 | 'empty_data' => '', |
| 221 | 221 | ]); |
| 222 | 222 | |
@@ -228,7 +228,7 @@ discard block |
||
| 228 | 228 | 'label' => false, |
| 229 | 229 | 'entry_options' => [ |
| 230 | 230 | 'measurement_unit' => $part->getPartUnit(), |
| 231 | - 'disabled' => ! $this->security->isGranted('lots.edit', $part), |
|
| 231 | + 'disabled' => !$this->security->isGranted('lots.edit', $part), |
|
| 232 | 232 | ], |
| 233 | 233 | 'by_reference' => false, |
| 234 | 234 | ]); |
@@ -241,14 +241,14 @@ discard block |
||
| 241 | 241 | 'label' => false, |
| 242 | 242 | 'entry_options' => [ |
| 243 | 243 | 'data_class' => PartAttachment::class, |
| 244 | - 'disabled' => ! $this->security->isGranted('attachments.edit', $part), |
|
| 244 | + 'disabled' => !$this->security->isGranted('attachments.edit', $part), |
|
| 245 | 245 | ], |
| 246 | 246 | 'by_reference' => false, |
| 247 | 247 | ]); |
| 248 | 248 | |
| 249 | 249 | $builder->add('master_picture_attachment', MasterPictureAttachmentType::class, [ |
| 250 | 250 | 'required' => false, |
| 251 | - 'disabled' => ! $this->security->isGranted('attachments.edit', $part), |
|
| 251 | + 'disabled' => !$this->security->isGranted('attachments.edit', $part), |
|
| 252 | 252 | 'label' => 'part.edit.master_attachment', |
| 253 | 253 | 'entity' => $part, |
| 254 | 254 | ]); |
@@ -263,7 +263,7 @@ discard block |
||
| 263 | 263 | 'prototype_data' => new Orderdetail(), |
| 264 | 264 | 'entry_options' => [ |
| 265 | 265 | 'measurement_unit' => $part->getPartUnit(), |
| 266 | - 'disabled' => ! $this->security->isGranted('orderdetails.edit', $part), |
|
| 266 | + 'disabled' => !$this->security->isGranted('orderdetails.edit', $part), |
|
| 267 | 267 | ], |
| 268 | 268 | ]); |
| 269 | 269 | |
@@ -275,7 +275,7 @@ discard block |
||
| 275 | 275 | 'by_reference' => false, |
| 276 | 276 | 'prototype_data' => new PartParameter(), |
| 277 | 277 | 'entry_options' => [ |
| 278 | - 'disabled' => ! $this->security->isGranted('parameters.edit', $part), |
|
| 278 | + 'disabled' => !$this->security->isGranted('parameters.edit', $part), |
|
| 279 | 279 | 'data_class' => PartParameter::class, |
| 280 | 280 | ], |
| 281 | 281 | ]); |
@@ -171,7 +171,7 @@ |
||
| 171 | 171 | $query = $qb->getQuery(); |
| 172 | 172 | $count = $query->getSingleScalarResult(); |
| 173 | 173 | |
| 174 | - return ! ($count > 0); |
|
| 174 | + return !($count > 0); |
|
| 175 | 175 | } |
| 176 | 176 | |
| 177 | 177 | /** |
@@ -98,7 +98,7 @@ |
||
| 98 | 98 | $tmp = ''; |
| 99 | 99 | |
| 100 | 100 | //The element is existing |
| 101 | - if ($target instanceof NamedElementInterface && ! empty($target->getName())) { |
|
| 101 | + if ($target instanceof NamedElementInterface && !empty($target->getName())) { |
|
| 102 | 102 | try { |
| 103 | 103 | $tmp = sprintf( |
| 104 | 104 | '<a href="%s">%s</a>', |
@@ -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(); |