@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | 'empty_data' => '', |
83 | 83 | 'label' => 'part.edit.name', |
84 | 84 | 'attr' => ['placeholder' => 'part.edit.name.placeholder'], |
85 | - 'disabled' => ! $this->security->isGranted('name.edit', $part), |
|
85 | + 'disabled' => !$this->security->isGranted('name.edit', $part), |
|
86 | 86 | ]) |
87 | 87 | ->add('description', CKEditorType::class, [ |
88 | 88 | 'required' => false, |
@@ -90,26 +90,26 @@ discard block |
||
90 | 90 | 'label' => 'part.edit.description', |
91 | 91 | 'config_name' => 'description_config', |
92 | 92 | 'attr' => ['placeholder' => 'part.edit.description.placeholder', 'rows' => 2], |
93 | - 'disabled' => ! $this->security->isGranted('description.edit', $part), |
|
93 | + 'disabled' => !$this->security->isGranted('description.edit', $part), |
|
94 | 94 | ]) |
95 | 95 | ->add('minAmount', SIUnitType::class, [ |
96 | 96 | 'attr' => ['min' => 0, 'placeholder' => 'part.editmininstock.placeholder'], |
97 | 97 | 'label' => 'part.edit.mininstock', |
98 | 98 | 'measurement_unit' => $part->getPartUnit(), |
99 | - 'disabled' => ! $this->security->isGranted('minamount.edit', $part), |
|
99 | + 'disabled' => !$this->security->isGranted('minamount.edit', $part), |
|
100 | 100 | ]) |
101 | 101 | ->add('category', StructuralEntityType::class, [ |
102 | 102 | 'class' => Category::class, |
103 | 103 | 'label' => 'part.edit.category', |
104 | 104 | 'disable_not_selectable' => true, |
105 | - 'disabled' => ! $this->security->isGranted('category.edit', $part), |
|
105 | + 'disabled' => !$this->security->isGranted('category.edit', $part), |
|
106 | 106 | ]) |
107 | 107 | ->add('footprint', StructuralEntityType::class, [ |
108 | 108 | 'class' => Footprint::class, |
109 | 109 | 'required' => false, |
110 | 110 | 'label' => 'part.edit.footprint', |
111 | 111 | 'disable_not_selectable' => true, |
112 | - 'disabled' => ! $this->security->isGranted('footprint.edit', $part), |
|
112 | + 'disabled' => !$this->security->isGranted('footprint.edit', $part), |
|
113 | 113 | ]) |
114 | 114 | ->add('tags', TextType::class, [ |
115 | 115 | 'required' => false, |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | 'attr' => [ |
119 | 119 | 'class' => 'tagsinput', |
120 | 120 | 'data-autocomplete' => $this->urlGenerator->generate('typeahead_tags', ['query' => 'QUERY']), ], |
121 | - 'disabled' => ! $this->security->isGranted('tags.edit', $part), |
|
121 | + 'disabled' => !$this->security->isGranted('tags.edit', $part), |
|
122 | 122 | ]); |
123 | 123 | |
124 | 124 | //Manufacturer section |
@@ -127,24 +127,24 @@ discard block |
||
127 | 127 | 'required' => false, |
128 | 128 | 'label' => 'part.edit.manufacturer.label', |
129 | 129 | 'disable_not_selectable' => true, |
130 | - 'disabled' => ! $this->security->isGranted('manufacturer.edit', $part), |
|
130 | + 'disabled' => !$this->security->isGranted('manufacturer.edit', $part), |
|
131 | 131 | ]) |
132 | 132 | ->add('manufacturer_product_url', UrlType::class, [ |
133 | 133 | 'required' => false, |
134 | 134 | 'empty_data' => '', |
135 | 135 | 'label' => 'part.edit.manufacturer_url.label', |
136 | - 'disabled' => ! $this->security->isGranted('mpn.edit', $part), |
|
136 | + 'disabled' => !$this->security->isGranted('mpn.edit', $part), |
|
137 | 137 | ]) |
138 | 138 | ->add('manufacturer_product_number', TextType::class, [ |
139 | 139 | 'required' => false, |
140 | 140 | 'empty_data' => '', |
141 | 141 | 'label' => 'part.edit.mpn', |
142 | - 'disabled' => ! $this->security->isGranted('mpn.edit', $part), ]) |
|
142 | + 'disabled' => !$this->security->isGranted('mpn.edit', $part), ]) |
|
143 | 143 | ->add('manufacturing_status', ChoiceType::class, [ |
144 | 144 | 'label' => 'part.edit.manufacturing_status', |
145 | 145 | 'choices' => $status_choices, |
146 | 146 | 'required' => false, |
147 | - 'disabled' => ! $this->security->isGranted('status.edit', $part), |
|
147 | + 'disabled' => !$this->security->isGranted('status.edit', $part), |
|
148 | 148 | ]); |
149 | 149 | |
150 | 150 | //Advanced section |
@@ -152,26 +152,26 @@ discard block |
||
152 | 152 | 'label_attr' => ['class' => 'checkbox-custom'], |
153 | 153 | 'required' => false, |
154 | 154 | 'label' => 'part.edit.needs_review', |
155 | - 'disabled' => ! $this->security->isGranted('edit', $part), |
|
155 | + 'disabled' => !$this->security->isGranted('edit', $part), |
|
156 | 156 | ]) |
157 | 157 | ->add('favorite', CheckboxType::class, [ |
158 | 158 | 'label_attr' => ['class' => 'checkbox-custom'], |
159 | 159 | 'required' => false, |
160 | 160 | 'label' => 'part.edit.is_favorite', |
161 | - 'disabled' => ! $this->security->isGranted('change_favorite', $part), |
|
161 | + 'disabled' => !$this->security->isGranted('change_favorite', $part), |
|
162 | 162 | ]) |
163 | 163 | ->add('mass', SIUnitType::class, [ |
164 | 164 | 'unit' => 'g', |
165 | 165 | 'label' => 'part.edit.mass', |
166 | 166 | 'required' => false, |
167 | - 'disabled' => ! $this->security->isGranted('mass.edit', $part), |
|
167 | + 'disabled' => !$this->security->isGranted('mass.edit', $part), |
|
168 | 168 | ]) |
169 | 169 | ->add('partUnit', StructuralEntityType::class, [ |
170 | 170 | 'class' => MeasurementUnit::class, |
171 | 171 | 'required' => false, |
172 | 172 | 'disable_not_selectable' => true, |
173 | 173 | 'label' => 'part.edit.partUnit', |
174 | - 'disabled' => ! $this->security->isGranted('unit.edit', $part), |
|
174 | + 'disabled' => !$this->security->isGranted('unit.edit', $part), |
|
175 | 175 | ]); |
176 | 176 | |
177 | 177 | //Comment section |
@@ -179,7 +179,7 @@ discard block |
||
179 | 179 | 'required' => false, |
180 | 180 | 'label' => 'part.edit.comment', |
181 | 181 | 'attr' => ['rows' => 4], |
182 | - 'disabled' => ! $this->security->isGranted('comment.edit', $part), 'empty_data' => '', |
|
182 | + 'disabled' => !$this->security->isGranted('comment.edit', $part), 'empty_data' => '', |
|
183 | 183 | ]); |
184 | 184 | |
185 | 185 | //Part Lots section |
@@ -190,7 +190,7 @@ discard block |
||
190 | 190 | 'label' => false, |
191 | 191 | 'entry_options' => [ |
192 | 192 | 'measurement_unit' => $part->getPartUnit(), |
193 | - 'disabled' => ! $this->security->isGranted('lots.edit', $part), |
|
193 | + 'disabled' => !$this->security->isGranted('lots.edit', $part), |
|
194 | 194 | ], |
195 | 195 | 'by_reference' => false, |
196 | 196 | ]); |
@@ -203,14 +203,14 @@ discard block |
||
203 | 203 | 'label' => false, |
204 | 204 | 'entry_options' => [ |
205 | 205 | 'data_class' => PartAttachment::class, |
206 | - 'disabled' => ! $this->security->isGranted('attachments.edit', $part), |
|
206 | + 'disabled' => !$this->security->isGranted('attachments.edit', $part), |
|
207 | 207 | ], |
208 | 208 | 'by_reference' => false, |
209 | 209 | ]); |
210 | 210 | |
211 | 211 | $builder->add('master_picture_attachment', MasterPictureAttachmentType::class, [ |
212 | 212 | 'required' => false, |
213 | - 'disabled' => ! $this->security->isGranted('attachments.edit', $part), |
|
213 | + 'disabled' => !$this->security->isGranted('attachments.edit', $part), |
|
214 | 214 | 'label' => 'part.edit.master_attachment', |
215 | 215 | 'entity' => $part, |
216 | 216 | ]); |
@@ -225,7 +225,7 @@ discard block |
||
225 | 225 | 'prototype_data' => new Orderdetail(), |
226 | 226 | 'entry_options' => [ |
227 | 227 | 'measurement_unit' => $part->getPartUnit(), |
228 | - 'disabled' => ! $this->security->isGranted('orderdetails.edit', $part), |
|
228 | + 'disabled' => !$this->security->isGranted('orderdetails.edit', $part), |
|
229 | 229 | ], |
230 | 230 | ]); |
231 | 231 |
@@ -46,13 +46,13 @@ |
||
46 | 46 | |
47 | 47 | public function buildForm(FormBuilderInterface $builder, array $options): void |
48 | 48 | { |
49 | - $builder->addEventListener(FormEvents::PRE_SET_DATA, function (FormEvent $event): void { |
|
49 | + $builder->addEventListener(FormEvents::PRE_SET_DATA, function(FormEvent $event): void { |
|
50 | 50 | $form = $event->getForm(); |
51 | 51 | /** @var User $user */ |
52 | 52 | $user = $event->getData(); |
53 | 53 | |
54 | 54 | //Only show setup fields, when google authenticator is not enabled |
55 | - if (! $user->isGoogleAuthenticatorEnabled()) { |
|
55 | + if (!$user->isGoogleAuthenticatorEnabled()) { |
|
56 | 56 | $form->add( |
57 | 57 | 'google_confirmation', |
58 | 58 | TextType::class, |
@@ -48,8 +48,8 @@ |
||
48 | 48 | { |
49 | 49 | $resolver->setDefaults([ |
50 | 50 | 'show_legend' => true, |
51 | - 'constraints' => function (Options $options) { |
|
52 | - if (! $options['disabled']) { |
|
51 | + 'constraints' => function(Options $options) { |
|
52 | + if (!$options['disabled']) { |
|
53 | 53 | return [new NoLockout()]; |
54 | 54 | } |
55 | 55 |
@@ -48,20 +48,20 @@ |
||
48 | 48 | { |
49 | 49 | parent::configureOptions($resolver); |
50 | 50 | |
51 | - $resolver->setDefault('perm_name', function (Options $options) { |
|
51 | + $resolver->setDefault('perm_name', function(Options $options) { |
|
52 | 52 | return $options['name']; |
53 | 53 | }); |
54 | 54 | |
55 | - $resolver->setDefault('label', function (Options $options) { |
|
56 | - if (! empty($this->perm_structure['perms'][$options['perm_name']]['label'])) { |
|
55 | + $resolver->setDefault('label', function(Options $options) { |
|
56 | + if (!empty($this->perm_structure['perms'][$options['perm_name']]['label'])) { |
|
57 | 57 | return $this->perm_structure['perms'][$options['perm_name']]['label']; |
58 | 58 | } |
59 | 59 | |
60 | 60 | return $options['name']; |
61 | 61 | }); |
62 | 62 | |
63 | - $resolver->setDefault('multi_checkbox', function (Options $options) { |
|
64 | - return ! $options['disabled']; |
|
63 | + $resolver->setDefault('multi_checkbox', function(Options $options) { |
|
64 | + return !$options['disabled']; |
|
65 | 65 | }); |
66 | 66 | |
67 | 67 | $resolver->setDefaults([ |
@@ -73,14 +73,14 @@ |
||
73 | 73 | { |
74 | 74 | parent::configureOptions($resolver); |
75 | 75 | |
76 | - $resolver->setDefault('group_name', function (Options $options) { |
|
76 | + $resolver->setDefault('group_name', function(Options $options) { |
|
77 | 77 | return trim($options['name']); |
78 | 78 | }); |
79 | 79 | |
80 | 80 | $resolver->setDefault('inherit', false); |
81 | 81 | |
82 | - $resolver->setDefault('label', function (Options $options) { |
|
83 | - if (! empty($this->perm_structure['groups'][$options['group_name']]['label'])) { |
|
82 | + $resolver->setDefault('label', function(Options $options) { |
|
83 | + if (!empty($this->perm_structure['groups'][$options['group_name']]['label'])) { |
|
84 | 84 | return $this->perm_structure['groups'][$options['group_name']]['label']; |
85 | 85 | } |
86 | 86 |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | $builder->add('downloadURL', CheckboxType::class, ['required' => false, |
98 | 98 | 'label' => 'attachment.edit.download_url', |
99 | 99 | 'mapped' => false, |
100 | - 'disabled' => ! $this->allow_attachments_download, |
|
100 | + 'disabled' => !$this->allow_attachments_download, |
|
101 | 101 | 'attr' => ['class' => 'form-control-sm'], |
102 | 102 | 'label_attr' => ['class' => 'checkbox-custom'], ]); |
103 | 103 | |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | //Check the secure file checkbox, if file is in securefile location |
118 | 118 | $builder->get('secureFile')->addEventListener( |
119 | 119 | FormEvents::PRE_SET_DATA, |
120 | - function (FormEvent $event): void { |
|
120 | + function(FormEvent $event): void { |
|
121 | 121 | $attachment = $event->getForm()->getParent()->getData(); |
122 | 122 | if ($attachment instanceof Attachment) { |
123 | 123 | $event->setData($attachment->isSecure()); |
@@ -62,9 +62,9 @@ discard block |
||
62 | 62 | public function buildForm(FormBuilderInterface $builder, array $options): void |
63 | 63 | { |
64 | 64 | $builder->addModelTransformer(new CallbackTransformer( |
65 | - function ($value) use ($options) { |
|
65 | + function($value) use ($options) { |
|
66 | 66 | return $this->transform($value, $options); |
67 | - }, function ($value) use ($options) { |
|
67 | + }, function($value) use ($options) { |
|
68 | 68 | return $this->reverseTransform($value, $options); |
69 | 69 | })); |
70 | 70 | } |
@@ -74,23 +74,23 @@ discard block |
||
74 | 74 | $resolver->setRequired(['class']); |
75 | 75 | $resolver->setDefaults([ |
76 | 76 | 'show_fullpath_in_subtext' => true, //When this is enabled, the full path will be shown in subtext |
77 | - 'subentities_of' => null, //Only show entities with the given parent class |
|
78 | - 'disable_not_selectable' => false, //Disable entries with not selectable property |
|
77 | + 'subentities_of' => null, //Only show entities with the given parent class |
|
78 | + 'disable_not_selectable' => false, //Disable entries with not selectable property |
|
79 | 79 | 'choice_value' => 'id', //Use the element id as option value and for comparing items |
80 | - 'choice_loader' => function (Options $options) { |
|
81 | - return new CallbackChoiceLoader(function () use ($options) { |
|
80 | + 'choice_loader' => function(Options $options) { |
|
81 | + return new CallbackChoiceLoader(function() use ($options) { |
|
82 | 82 | return $this->getEntries($options); |
83 | 83 | }); |
84 | - }, 'choice_label' => function ($choice, $key, $value) { |
|
84 | + }, 'choice_label' => function($choice, $key, $value) { |
|
85 | 85 | return $this->generateChoiceLabels($choice, $key, $value); |
86 | - }, 'choice_attr' => function ($choice, $key, $value) { |
|
86 | + }, 'choice_attr' => function($choice, $key, $value) { |
|
87 | 87 | return $this->generateChoiceAttr($choice, $key, $value); |
88 | 88 | }, |
89 | 89 | ]); |
90 | 90 | |
91 | 91 | $resolver->setDefault('empty_message', null); |
92 | 92 | |
93 | - $resolver->setDefault('attr', function (Options $options) { |
|
93 | + $resolver->setDefault('attr', function(Options $options) { |
|
94 | 94 | $tmp = ['class' => 'selectpicker', 'data-live-search' => true]; |
95 | 95 | if ($options['empty_message']) { |
96 | 96 | $tmp['data-none-Selected-Text'] = $options['empty_message']; |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | // This options allows you to override the currency shown for the null value |
54 | 54 | $resolver->setDefault('base_currency', null); |
55 | 55 | |
56 | - $resolver->setDefault('empty_message', function (Options $options) { |
|
56 | + $resolver->setDefault('empty_message', function(Options $options) { |
|
57 | 57 | //By default we use the global base currency: |
58 | 58 | $iso_code = $this->base_currency; |
59 | 59 | |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | /** @var Currency $choice */ |
95 | 95 | $tmp = []; |
96 | 96 | |
97 | - if (! empty($choice->getIsoCode())) { |
|
97 | + if (!empty($choice->getIsoCode())) { |
|
98 | 98 | //Show the name of the currency |
99 | 99 | $tmp += ['data-subtext' => $choice->getName()]; |
100 | 100 | } |
@@ -42,14 +42,14 @@ discard block |
||
42 | 42 | $resolver->setDefaults([ |
43 | 43 | 'filter' => 'picture', |
44 | 44 | 'attr' => ['class' => 'selectpicker'], |
45 | - 'choice_attr' => function (Options $options) { |
|
46 | - return function ($choice, $key, $value) use ($options) { |
|
45 | + 'choice_attr' => function(Options $options) { |
|
46 | + return function($choice, $key, $value) use ($options) { |
|
47 | 47 | /** @var Attachment $choice */ |
48 | 48 | $tmp = ['data-subtext' => $choice->getFilename() ?? 'URL']; |
49 | 49 | |
50 | - if ('picture' === $options['filter'] && ! $choice->isPicture()) { |
|
50 | + if ('picture' === $options['filter'] && !$choice->isPicture()) { |
|
51 | 51 | $tmp += ['disabled' => 'disabled']; |
52 | - } elseif ('3d_model' === $options['filter'] && ! $choice->is3DModel()) { |
|
52 | + } elseif ('3d_model' === $options['filter'] && !$choice->is3DModel()) { |
|
53 | 53 | $tmp += ['disabled' => 'disabled']; |
54 | 54 | } |
55 | 55 | |
@@ -57,13 +57,13 @@ discard block |
||
57 | 57 | }; |
58 | 58 | }, |
59 | 59 | 'choice_label' => 'name', |
60 | - 'class' => function (Options $options) { |
|
60 | + 'class' => function(Options $options) { |
|
61 | 61 | $short_class_name = (new \ReflectionClass($options['entity']))->getShortName(); |
62 | 62 | //Category becomes CategoryAttachment |
63 | 63 | return 'App\\Entity\\Attachments\\'.$short_class_name.'Attachment'; |
64 | 64 | }, |
65 | - 'query_builder' => function (Options $options) { |
|
66 | - return function (EntityRepository $er) use ($options) { |
|
65 | + 'query_builder' => function(Options $options) { |
|
66 | + return function(EntityRepository $er) use ($options) { |
|
67 | 67 | $entity = $options['entity']; |
68 | 68 | if (null === $entity->getID()) { |
69 | 69 | //This query is always false, so we get empty results |