@@ -103,7 +103,7 @@ |
||
| 103 | 103 | 'currency' => Currency::class, |
| 104 | 104 | ]; |
| 105 | 105 | |
| 106 | - if (! isset($arr[$type])) { |
|
| 106 | + if (!isset($arr[$type])) { |
|
| 107 | 107 | throw new \InvalidArgumentException('No count for the given type available!'); |
| 108 | 108 | } |
| 109 | 109 | |
@@ -43,7 +43,7 @@ |
||
| 43 | 43 | |
| 44 | 44 | public function setMode(string $mode): void |
| 45 | 45 | { |
| 46 | - if (! in_array($mode, self::ALLOWED_MODES, true)) { |
|
| 46 | + if (!in_array($mode, self::ALLOWED_MODES, true)) { |
|
| 47 | 47 | throw new \InvalidArgumentException('Invalid mode passed!'); |
| 48 | 48 | } |
| 49 | 49 | $this->mode = $mode; |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | */ |
| 80 | 80 | public function revertEntityToTimestamp(AbstractDBElement $element, \DateTime $timestamp, array $reverted_elements = []): void |
| 81 | 81 | { |
| 82 | - if (! $element instanceof TimeStampableInterface) { |
|
| 82 | + if (!$element instanceof TimeStampableInterface) { |
|
| 83 | 83 | throw new \InvalidArgumentException('$element must have a Timestamp!'); |
| 84 | 84 | } |
| 85 | 85 | |
@@ -153,7 +153,7 @@ discard block |
||
| 153 | 153 | foreach ($target_elements as $target_element) { |
| 154 | 154 | if (null !== $target_element && $element->getLastModified() >= $timestamp) { |
| 155 | 155 | //Remove the element from collection, if it did not existed at $timestamp |
| 156 | - if (! $this->repo->getElementExistedAtTimestamp($target_element, $timestamp)) { |
|
| 156 | + if (!$this->repo->getElementExistedAtTimestamp($target_element, $timestamp)) { |
|
| 157 | 157 | if ($target_elements instanceof Collection) { |
| 158 | 158 | $target_elements->removeElement($target_element); |
| 159 | 159 | } |
@@ -173,10 +173,10 @@ discard block |
||
| 173 | 173 | public function applyEntry(AbstractDBElement $element, TimeTravelInterface $logEntry): void |
| 174 | 174 | { |
| 175 | 175 | //Skip if this does not provide any info... |
| 176 | - if (! $logEntry->hasOldDataInformations()) { |
|
| 176 | + if (!$logEntry->hasOldDataInformations()) { |
|
| 177 | 177 | return; |
| 178 | 178 | } |
| 179 | - if (! $element instanceof TimeStampableInterface) { |
|
| 179 | + if (!$element instanceof TimeStampableInterface) { |
|
| 180 | 180 | return; |
| 181 | 181 | } |
| 182 | 182 | $metadata = $this->em->getClassMetadata(get_class($element)); |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | $str .= '<error>'.$this->translator->trans($key).'</error>: '; |
| 92 | 92 | } |
| 93 | 93 | $str .= $value; |
| 94 | - if (! empty($str)) { |
|
| 94 | + if (!empty($str)) { |
|
| 95 | 95 | $tmp[] = $str; |
| 96 | 96 | } |
| 97 | 97 | } |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | $str .= '<b>'.$this->translator->trans($key).'</b>: '; |
| 117 | 117 | } |
| 118 | 118 | $str .= $value; |
| 119 | - if (! empty($str)) { |
|
| 119 | + if (!empty($str)) { |
|
| 120 | 120 | $tmp[] = $str; |
| 121 | 121 | } |
| 122 | 122 | } |
@@ -186,7 +186,7 @@ discard block |
||
| 186 | 186 | '%s <i class="fas fa-long-arrow-alt-right"></i> %s (%s)', |
| 187 | 187 | $context->getOldInstock(), |
| 188 | 188 | $context->getNewInstock(), |
| 189 | - (! $context->isWithdrawal() ? '+' : '-').$context->getDifference(true) |
|
| 189 | + (!$context->isWithdrawal() ? '+' : '-').$context->getDifference(true) |
|
| 190 | 190 | ); |
| 191 | 191 | $array['log.instock_changed.comment'] = htmlspecialchars($context->getComment()); |
| 192 | 192 | } |
@@ -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 | } |
@@ -82,9 +82,9 @@ discard block |
||
| 82 | 82 | public function buildForm(FormBuilderInterface $builder, array $options): void |
| 83 | 83 | { |
| 84 | 84 | $builder->addModelTransformer(new CallbackTransformer( |
| 85 | - function ($value) use ($options) { |
|
| 85 | + function($value) use ($options) { |
|
| 86 | 86 | return $this->transform($value, $options); |
| 87 | - }, function ($value) use ($options) { |
|
| 87 | + }, function($value) use ($options) { |
|
| 88 | 88 | return $this->reverseTransform($value, $options); |
| 89 | 89 | })); |
| 90 | 90 | } |
@@ -94,18 +94,18 @@ discard block |
||
| 94 | 94 | $resolver->setRequired(['class']); |
| 95 | 95 | $resolver->setDefaults([ |
| 96 | 96 | 'show_fullpath_in_subtext' => true, //When this is enabled, the full path will be shown in subtext |
| 97 | - 'subentities_of' => null, //Only show entities with the given parent class |
|
| 98 | - 'disable_not_selectable' => false, //Disable entries with not selectable property |
|
| 97 | + 'subentities_of' => null, //Only show entities with the given parent class |
|
| 98 | + 'disable_not_selectable' => false, //Disable entries with not selectable property |
|
| 99 | 99 | 'choice_value' => 'id', //Use the element id as option value and for comparing items |
| 100 | - 'choice_loader' => function (Options $options) { |
|
| 101 | - return new CallbackChoiceLoader(function () use ($options) { |
|
| 100 | + 'choice_loader' => function(Options $options) { |
|
| 101 | + return new CallbackChoiceLoader(function() use ($options) { |
|
| 102 | 102 | return $this->getEntries($options); |
| 103 | 103 | }); |
| 104 | 104 | }, |
| 105 | - 'choice_label' => function ($choice, $key, $value) { |
|
| 105 | + 'choice_label' => function($choice, $key, $value) { |
|
| 106 | 106 | return $this->generateChoiceLabels($choice, $key, $value); |
| 107 | 107 | }, |
| 108 | - 'choice_attr' => function ($choice, $key, $value) { |
|
| 108 | + 'choice_attr' => function($choice, $key, $value) { |
|
| 109 | 109 | return $this->generateChoiceAttr($choice, $key, $value); |
| 110 | 110 | }, |
| 111 | 111 | 'choice_translation_domain' => false, //Don't translate the entity names |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | |
| 114 | 114 | $resolver->setDefault('empty_message', null); |
| 115 | 115 | |
| 116 | - $resolver->setDefault('attr', function (Options $options) { |
|
| 116 | + $resolver->setDefault('attr', function(Options $options) { |
|
| 117 | 117 | $tmp = [ |
| 118 | 118 | 'class' => 'selectpicker', |
| 119 | 119 | 'data-live-search' => true, |
@@ -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>', |