@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | |
39 | 39 | public function convertToDatabaseValue($value, AbstractPlatform $platform) |
40 | 40 | { |
41 | - if (! self::$utc_timezone) { |
|
41 | + if (!self::$utc_timezone) { |
|
42 | 42 | self::$utc_timezone = new \DateTimeZone('UTC'); |
43 | 43 | } |
44 | 44 | |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | |
52 | 52 | public function convertToPHPValue($value, AbstractPlatform $platform) |
53 | 53 | { |
54 | - if (! self::$utc_timezone) { |
|
54 | + if (!self::$utc_timezone) { |
|
55 | 55 | self::$utc_timezone = new \DateTimeZone('UTC'); |
56 | 56 | } |
57 | 57 | |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | self::$utc_timezone |
66 | 66 | ); |
67 | 67 | |
68 | - if (! $converted) { |
|
68 | + if (!$converted) { |
|
69 | 69 | throw ConversionException::conversionFailedFormat($value, $this->getName(), $platform->getDateTimeFormatString()); |
70 | 70 | } |
71 | 71 |
@@ -53,7 +53,7 @@ |
||
53 | 53 | */ |
54 | 54 | public function checkPostAuth(UserInterface $user): void |
55 | 55 | { |
56 | - if (! $user instanceof User) { |
|
56 | + if (!$user instanceof User) { |
|
57 | 57 | return; |
58 | 58 | } |
59 | 59 |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | ); |
96 | 96 | |
97 | 97 | //Check if user is allowed to read info, otherwise apply placeholder |
98 | - if ((null !== $annotation) && ! $this->isGranted('read', $annotation, $element)) { |
|
98 | + if ((null !== $annotation) && !$this->isGranted('read', $annotation, $element)) { |
|
99 | 99 | $property->setAccessible(true); |
100 | 100 | $value = $annotation->getPlaceholder(); |
101 | 101 | |
@@ -143,8 +143,8 @@ discard block |
||
143 | 143 | $property->setAccessible(true); |
144 | 144 | |
145 | 145 | //If the user is not allowed to edit or read this property, reset all values. |
146 | - if ((! $this->isGranted('read', $annotation, $element) |
|
147 | - || ! $this->isGranted('edit', $annotation, $element))) { |
|
146 | + if ((!$this->isGranted('read', $annotation, $element) |
|
147 | + || !$this->isGranted('edit', $annotation, $element))) { |
|
148 | 148 | //Set value to old value, so that there a no change to this property |
149 | 149 | if (isset($old_data[$property->getName()])) { |
150 | 150 | $property->setValue($element, $old_data[$property->getName()]); |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | */ |
168 | 168 | protected function isRunningFromCLI() |
169 | 169 | { |
170 | - if (empty($_SERVER['REMOTE_ADDR']) && ! isset($_SERVER['HTTP_USER_AGENT']) && \count($_SERVER['argv']) > 0) { |
|
170 | + if (empty($_SERVER['REMOTE_ADDR']) && !isset($_SERVER['HTTP_USER_AGENT']) && \count($_SERVER['argv']) > 0) { |
|
171 | 171 | return true; |
172 | 172 | } |
173 | 173 | |
@@ -200,7 +200,7 @@ discard block |
||
200 | 200 | } |
201 | 201 | |
202 | 202 | //Check if we have already have saved the permission, otherwise save it to cache |
203 | - if (! isset($this->perm_cache[$mode][\get_class($element)][$operation])) { |
|
203 | + if (!isset($this->perm_cache[$mode][\get_class($element)][$operation])) { |
|
204 | 204 | $this->perm_cache[$mode][\get_class($element)][$operation] = $this->security->isGranted($operation, $element); |
205 | 205 | } |
206 | 206 |
@@ -58,7 +58,7 @@ |
||
58 | 58 | } |
59 | 59 | |
60 | 60 | // if the user is anonymous, we use the anonymous user. |
61 | - if (! $user instanceof User) { |
|
61 | + if (!$user instanceof User) { |
|
62 | 62 | $repo = $this->entityManager->getRepository(User::class); |
63 | 63 | $user = $repo->getAnonymousUser(); |
64 | 64 | if (null === $user) { |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | ]); |
80 | 80 | |
81 | 81 | //Add pricedetails after we know the data, so we can set the default currency |
82 | - $builder->addEventListener(FormEvents::PRE_SET_DATA, function (FormEvent $event) use ($options): void { |
|
82 | + $builder->addEventListener(FormEvents::PRE_SET_DATA, function(FormEvent $event) use ($options): void { |
|
83 | 83 | /** @var Orderdetail $orderdetail */ |
84 | 84 | $orderdetail = $event->getData(); |
85 | 85 | |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | 'prototype_data' => $dummy_pricedetail, |
98 | 98 | 'by_reference' => false, |
99 | 99 | 'entry_options' => [ |
100 | - 'disabled' => ! $this->security->isGranted('@parts_prices.edit'), |
|
100 | + 'disabled' => !$this->security->isGranted('@parts_prices.edit'), |
|
101 | 101 | 'measurement_unit' => $options['measurement_unit'], |
102 | 102 | ], |
103 | 103 | ]); |
@@ -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([ |