@@ -66,12 +66,12 @@ |
||
66 | 66 | //Disable import if user is not allowed to create elements. |
67 | 67 | $entity = new $data['entity_class'](); |
68 | 68 | $perm_name = "create"; |
69 | - $disabled = ! $this->security->isGranted($perm_name, $entity); |
|
69 | + $disabled = !$this->security->isGranted($perm_name, $entity); |
|
70 | 70 | |
71 | 71 | $builder |
72 | 72 | |
73 | 73 | ->add('format', ChoiceType::class, [ |
74 | - 'choices' => ['JSON' => 'json', 'XML' => 'xml','CSV' => 'csv' ,'YAML' => 'yaml'], |
|
74 | + 'choices' => ['JSON' => 'json', 'XML' => 'xml', 'CSV' => 'csv', 'YAML' => 'yaml'], |
|
75 | 75 | 'label' => $this->trans->trans('export.format'), |
76 | 76 | 'disabled' => $disabled]) |
77 | 77 | ->add('csv_separator', TextType::class, ['data' => ';', |
@@ -65,7 +65,7 @@ |
||
65 | 65 | //Disable import if user is not allowed to create elements. |
66 | 66 | $entity = new $data['entity_class'](); |
67 | 67 | $perm_name = "create"; |
68 | - $disabled = ! $this->security->isGranted($perm_name, $entity); |
|
68 | + $disabled = !$this->security->isGranted($perm_name, $entity); |
|
69 | 69 | |
70 | 70 | $builder |
71 | 71 | ->add('lines', TextareaType::class, ['data' => '', |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | 'label' => $this->trans->trans('entity.edit.not_selectable'), |
84 | 84 | 'help' => $this->trans->trans('entity.edit.not_selectable.help'), |
85 | 85 | 'label_attr' => ['class' => 'checkbox-custom'], |
86 | - 'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity) ]) |
|
86 | + 'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity)]) |
|
87 | 87 | |
88 | 88 | ->add('comment', CKEditorType::class, ['required' => false, 'empty_data' => '', |
89 | 89 | 'label' => $this->trans->trans('comment.label'), |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | |
95 | 95 | //Buttons |
96 | 96 | $builder->add('save', SubmitType::class, [ |
97 | - 'label' => $is_new ? $this->trans->trans('entity.create') : $this->trans->trans('entity.edit.save'), |
|
97 | + 'label' => $is_new ? $this->trans->trans('entity.create') : $this->trans->trans('entity.edit.save'), |
|
98 | 98 | 'attr' => ['class' => $is_new ? 'btn-success' : ''], |
99 | 99 | 'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity)]) |
100 | 100 | ->add('reset', ResetType::class, ['label' => 'entity.edit.reset', |
@@ -217,12 +217,12 @@ |
||
217 | 217 | 'label' => $this->trans->trans('part.edit.master_attachment'), |
218 | 218 | 'class' => PartAttachment::class, |
219 | 219 | 'attr' => ['class' => 'selectpicker'], |
220 | - 'choice_attr' => function ($choice, $key, $value) { |
|
220 | + 'choice_attr' => function($choice, $key, $value) { |
|
221 | 221 | /** @var Attachment $choice */ |
222 | 222 | return ['data-subtext' => $choice->getFilename() ?? "URL"]; |
223 | 223 | }, |
224 | 224 | 'choice_label' => 'name', |
225 | - 'query_builder' => function (EntityRepository $er) use ($part) { |
|
225 | + 'query_builder' => function(EntityRepository $er) use ($part) { |
|
226 | 226 | if ($part->getID() == null) { |
227 | 227 | //This query is always false, so we get empty results |
228 | 228 | return $er->createQueryBuilder('u')->where('0 = 2'); |
@@ -133,12 +133,12 @@ discard block |
||
133 | 133 | } |
134 | 134 | |
135 | 135 | if (isset($options['tag'])) { |
136 | - $builder->andWhere('part.tags LIKE :tag')->setParameter('tag', '%' . $options['tag'] . '%'); |
|
136 | + $builder->andWhere('part.tags LIKE :tag')->setParameter('tag', '%'.$options['tag'].'%'); |
|
137 | 137 | } |
138 | 138 | |
139 | 139 | if (isset($options['search'])) { |
140 | 140 | $builder->AndWhere('part.name LIKE :search')->orWhere('part.description LIKE :search')->orWhere('part.comment LIKE :search') |
141 | - ->setParameter('search', '%' . $options['search'] . '%'); |
|
141 | + ->setParameter('search', '%'.$options['search'].'%'); |
|
142 | 142 | } |
143 | 143 | } |
144 | 144 | |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | $dataTable |
152 | 152 | ->add('name', TextColumn::class, [ |
153 | 153 | 'label' => $this->translator->trans('part.table.name'), |
154 | - 'render' => function ($value, Part $context) { |
|
154 | + 'render' => function($value, Part $context) { |
|
155 | 155 | return sprintf( |
156 | 156 | '<a href="%s">%s</a>', |
157 | 157 | $this->urlGenerator->infoURL($context), |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | ]) |
181 | 181 | ->add('storelocation', TextColumn::class, [ |
182 | 182 | 'label' => $this->translator->trans('part.table.storeLocations'), |
183 | - 'render' => function ($value, Part $context) { |
|
183 | + 'render' => function($value, Part $context) { |
|
184 | 184 | $tmp = array(); |
185 | 185 | foreach ($context->getPartLots() as $lot) { |
186 | 186 | //Ignore lots without storelocation |
@@ -199,7 +199,7 @@ discard block |
||
199 | 199 | ]) |
200 | 200 | ->add('amount', TextColumn::class, [ |
201 | 201 | 'label' => $this->translator->trans('part.table.amount'), |
202 | - 'render' => function ($value, Part $context) { |
|
202 | + 'render' => function($value, Part $context) { |
|
203 | 203 | $amount = $context->getAmountSum(); |
204 | 204 | return $this->amountFormatter->format($amount, $context->getPartUnit()); |
205 | 205 | } |
@@ -207,7 +207,7 @@ discard block |
||
207 | 207 | ->add('minamount', TextColumn::class, [ |
208 | 208 | 'label' => $this->translator->trans('part.table.minamount'), |
209 | 209 | 'visible' => false, |
210 | - 'render' => function ($value, Part $context) { |
|
210 | + 'render' => function($value, Part $context) { |
|
211 | 211 | return $this->amountFormatter->format($value, $context->getPartUnit()); |
212 | 212 | } |
213 | 213 | ]) |
@@ -271,7 +271,7 @@ discard block |
||
271 | 271 | }, |
272 | 272 | 'entity' => Part::class, |
273 | 273 | 'criteria' => [ |
274 | - function (QueryBuilder $builder) use ($options) { |
|
274 | + function(QueryBuilder $builder) use ($options) { |
|
275 | 275 | $this->buildCriteria($builder, $options); |
276 | 276 | }, |
277 | 277 | new SearchCriteriaProvider() |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | return "indeterminate"; |
128 | 128 | } |
129 | 129 | |
130 | - throw new \InvalidArgumentException('Invalid value encountered!: ' . $value); |
|
130 | + throw new \InvalidArgumentException('Invalid value encountered!: '.$value); |
|
131 | 131 | } |
132 | 132 | |
133 | 133 | /** |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | case "indeterminate": |
169 | 169 | return null; |
170 | 170 | default: |
171 | - throw new \InvalidArgumentException('Invalid value encountered!: ' . $value); |
|
171 | + throw new \InvalidArgumentException('Invalid value encountered!: '.$value); |
|
172 | 172 | } |
173 | 173 | } |
174 | 174 | } |
175 | 175 | \ No newline at end of file |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | foreach ($this->permission_structure['groups'] as $group) { |
65 | 65 | if (isset($group['label'])) { |
66 | 66 | $catalogue->add([ |
67 | - $group['label'] => '__' . $group['label'] |
|
67 | + $group['label'] => '__'.$group['label'] |
|
68 | 68 | ]); |
69 | 69 | } |
70 | 70 | } |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | foreach ($this->permission_structure['perms'] as $perm) { |
74 | 74 | if (isset($perm['label'])) { |
75 | 75 | $catalogue->add([ |
76 | - $perm['label'] => '__' . $perm['label'] |
|
76 | + $perm['label'] => '__'.$perm['label'] |
|
77 | 77 | ]); |
78 | 78 | } |
79 | 79 | |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | foreach ($perm['operations'] as $op) { |
82 | 82 | if (isset($op['label'])) { |
83 | 83 | $catalogue->add([ |
84 | - $op['label'] => '__' . $op['label'] |
|
84 | + $op['label'] => '__'.$op['label'] |
|
85 | 85 | ]); |
86 | 86 | } |
87 | 87 | } |
@@ -59,11 +59,11 @@ discard block |
||
59 | 59 | { |
60 | 60 | parent::configureOptions($resolver); |
61 | 61 | |
62 | - $resolver->setDefault('perm_name', function (Options $options) { |
|
62 | + $resolver->setDefault('perm_name', function(Options $options) { |
|
63 | 63 | return $options['name']; |
64 | 64 | }); |
65 | 65 | |
66 | - $resolver->setDefault('label', function (Options $options) { |
|
66 | + $resolver->setDefault('label', function(Options $options) { |
|
67 | 67 | if (!empty($this->perm_structure['perms'][$options['perm_name']]['label'])) { |
68 | 68 | return $this->perm_structure['perms'][$options['perm_name']]['label']; |
69 | 69 | } |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | return $options['name']; |
72 | 72 | }); |
73 | 73 | |
74 | - $resolver->setDefault('multi_checkbox', function (Options $options) { |
|
74 | + $resolver->setDefault('multi_checkbox', function(Options $options) { |
|
75 | 75 | return !$options['disabled']; |
76 | 76 | }); |
77 | 77 |
@@ -51,7 +51,7 @@ |
||
51 | 51 | protected function voteOnUser($attribute, $subject, User $user): bool |
52 | 52 | { |
53 | 53 | if ($subject instanceof Group) { |
54 | - return $this->resolver->inherit($user,'groups', $attribute) ?? false; |
|
54 | + return $this->resolver->inherit($user, 'groups', $attribute) ?? false; |
|
55 | 55 | } |
56 | 56 | |
57 | 57 | return false; |