@@ -30,15 +30,15 @@ |
||
30 | 30 | |
31 | 31 | /** Migrate the part locations for parts with known instock */ |
32 | 32 | $this->addSql( |
33 | - 'INSERT INTO part_lots (id_part, id_store_location, amount, instock_unknown, last_modified, datetime_added) ' . |
|
34 | - 'SELECT parts.id, parts.id_storelocation, parts.instock, 0, NOW(), NOW() FROM parts ' . |
|
33 | + 'INSERT INTO part_lots (id_part, id_store_location, amount, instock_unknown, last_modified, datetime_added) '. |
|
34 | + 'SELECT parts.id, parts.id_storelocation, parts.instock, 0, NOW(), NOW() FROM parts '. |
|
35 | 35 | 'WHERE parts.instock >= 0' |
36 | 36 | ); |
37 | 37 | |
38 | 38 | //Migrate part locations for parts with unknown instock |
39 | 39 | $this->addSql( |
40 | - 'INSERT INTO part_lots (id_part, id_store_location, amount, instock_unknown, last_modified, datetime_added) ' . |
|
41 | - 'SELECT parts.id, parts.id_storelocation, 0, 1, NOW(), NOW() FROM parts ' . |
|
40 | + 'INSERT INTO part_lots (id_part, id_store_location, amount, instock_unknown, last_modified, datetime_added) '. |
|
41 | + 'SELECT parts.id, parts.id_storelocation, 0, 1, NOW(), NOW() FROM parts '. |
|
42 | 42 | 'WHERE parts.instock = -2' |
43 | 43 | ); |
44 | 44 |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | ->add('description', CKEditorType::class, ['required' => false, 'empty_data' => '', |
82 | 82 | 'label' => 'description.label', 'help' => 'bbcode.hint', 'config_name' => 'description_config', |
83 | 83 | 'attr' => ['placeholder' => 'part.description.placeholder', 'rows' => 2], |
84 | - 'disabled' => !$this->security->isGranted('description.edit', $part) ]) |
|
84 | + 'disabled' => !$this->security->isGranted('description.edit', $part)]) |
|
85 | 85 | ->add('minAmount', SIUnitType::class, |
86 | 86 | ['attr' => ['min' => 0, 'placeholder' => 'part.mininstock.placeholder'], 'label' => 'mininstock.label', |
87 | 87 | 'show_prefix' => $use_si_prefix, "unit" => $part_unit_name, "is_integer" => !$part->useFloatAmount(), |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | 'disabled' => !$this->security->isGranted('move', $part), ]) |
95 | 95 | ->add('tags', TextType::class, ['required' => false, 'label' => 'part.tags', 'empty_data' => "", |
96 | 96 | 'attr' => ['data-role' => 'tagsinput'], |
97 | - 'disabled' => !$this->security->isGranted('edit', $part) ]); |
|
97 | + 'disabled' => !$this->security->isGranted('edit', $part)]); |
|
98 | 98 | |
99 | 99 | //Manufacturer section |
100 | 100 | $builder->add('manufacturer', StructuralEntityType::class, ['class' => Manufacturer::class, |
@@ -74,9 +74,9 @@ discard block |
||
74 | 74 | public function buildForm(FormBuilderInterface $builder, array $options) |
75 | 75 | { |
76 | 76 | $builder->addModelTransformer(new CallbackTransformer( |
77 | - function ($value) use ($options){ |
|
77 | + function($value) use ($options){ |
|
78 | 78 | return $this->transform($value, $options); |
79 | - }, function ($value) use ($options) { |
|
79 | + }, function($value) use ($options) { |
|
80 | 80 | return $this->reverseTransform($value, $options); |
81 | 81 | })); |
82 | 82 | } |
@@ -86,16 +86,16 @@ discard block |
||
86 | 86 | $resolver->setRequired(['class']); |
87 | 87 | $resolver->setDefaults(['attr' => ['class' => 'selectpicker', 'data-live-search' => true], |
88 | 88 | 'show_fullpath_in_subtext' => true, //When this is enabled, the full path will be shown in subtext |
89 | - 'subentities_of' => null, //Only show entities with the given parent class |
|
90 | - 'disable_not_selectable' => false, //Disable entries with not selectable property |
|
89 | + 'subentities_of' => null, //Only show entities with the given parent class |
|
90 | + 'disable_not_selectable' => false, //Disable entries with not selectable property |
|
91 | 91 | 'choice_value' => 'id', //Use the element id as option value and for comparing items |
92 | - 'choice_loader' => function (Options $options) { |
|
93 | - return new CallbackChoiceLoader(function () use ($options) { |
|
92 | + 'choice_loader' => function(Options $options) { |
|
93 | + return new CallbackChoiceLoader(function() use ($options) { |
|
94 | 94 | return $this->getEntries($options); |
95 | 95 | }); |
96 | - }, 'choice_label' => function ($choice, $key, $value) { |
|
96 | + }, 'choice_label' => function($choice, $key, $value) { |
|
97 | 97 | return $this->generateChoiceLabels($choice, $key, $value); |
98 | - }, 'choice_attr' => function ($choice, $key, $value) { |
|
98 | + }, 'choice_attr' => function($choice, $key, $value) { |
|
99 | 99 | return $this->generateChoiceAttr($choice, $key, $value); |
100 | 100 | } |
101 | 101 | ]); |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | |
131 | 131 | |
132 | 132 | $tmp = str_repeat(' ', $choice->getLevel()); //Use 3 spaces for intendation |
133 | - $tmp .= htmlspecialchars($choice->getName($parent)); |
|
133 | + $tmp .= htmlspecialchars($choice->getName($parent)); |
|
134 | 134 | return $tmp; |
135 | 135 | } |
136 | 136 |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | $resolver->setDefaults([ |
58 | 58 | 'show_prefix' => true, |
59 | 59 | 'is_integer' => false, |
60 | - 'error_mapping' => [ '.' => 'value'] |
|
60 | + 'error_mapping' => ['.' => 'value'] |
|
61 | 61 | ]); |
62 | 62 | |
63 | 63 | $resolver->setRequired('unit'); |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | |
71 | 71 | if ($options['show_prefix']) { |
72 | 72 | $builder->add('prefix', ChoiceType::class, [ |
73 | - 'choices' => ['M' => 6, 'k' => 3, '' => 0, 'm' => -3 ] |
|
73 | + 'choices' => ['M' => 6, 'k' => 3, '' => 0, 'm' => -3] |
|
74 | 74 | ]); |
75 | 75 | } |
76 | 76 |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | $em->persist($entity); |
77 | 77 | $em->flush(); |
78 | 78 | $this->addFlash('success', $this->translator->trans('entity.edit_flash')); |
79 | - } elseif ($form->isSubmitted() && ! $form->isValid()) { |
|
79 | + } elseif ($form->isSubmitted() && !$form->isValid()) { |
|
80 | 80 | $this->addFlash('error', $this->translator->trans('entity.edit_flash.invalid')); |
81 | 81 | } |
82 | 82 | |
@@ -106,8 +106,8 @@ discard block |
||
106 | 106 | $em->flush(); |
107 | 107 | $this->addFlash('success', $this->translator->trans('entity.created_flash')); |
108 | 108 | |
109 | - return $this->redirectToRoute($this->route_base . '_edit', ['id' => $new_entity->getID()]); |
|
110 | - } elseif ($form->isSubmitted() && ! $form->isValid()) { |
|
109 | + return $this->redirectToRoute($this->route_base.'_edit', ['id' => $new_entity->getID()]); |
|
110 | + } elseif ($form->isSubmitted() && !$form->isValid()) { |
|
111 | 111 | $this->addFlash('error', $this->translator->trans('entity.created_flash.invalid')); |
112 | 112 | } |
113 | 113 | |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | |
128 | 128 | foreach ($errors as $name => $error) { |
129 | 129 | /** @var $error ConstraintViolationList */ |
130 | - $this->addFlash('error', $name . ':' . $error); |
|
130 | + $this->addFlash('error', $name.':'.$error); |
|
131 | 131 | } |
132 | 132 | } |
133 | 133 | |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | //Show errors to user: |
147 | 147 | foreach ($errors as $name => $error) { |
148 | 148 | /** @var $error ConstraintViolationList */ |
149 | - $this->addFlash('error', $name . ':' . $error); |
|
149 | + $this->addFlash('error', $name.':'.$error); |
|
150 | 150 | } |
151 | 151 | } |
152 | 152 | |
@@ -187,7 +187,7 @@ discard block |
||
187 | 187 | $this->addFlash('success', 'attachment_type.deleted'); |
188 | 188 | } |
189 | 189 | |
190 | - return $this->redirectToRoute($this->route_base . '_new'); |
|
190 | + return $this->redirectToRoute($this->route_base.'_new'); |
|
191 | 191 | } |
192 | 192 | |
193 | 193 | protected function _exportAll(EntityManagerInterface $em, EntityExporter $exporter, Request $request) |
@@ -198,7 +198,7 @@ discard block |
||
198 | 198 | |
199 | 199 | $entities = $em->getRepository($this->entity_class)->findAll(); |
200 | 200 | |
201 | - return $exporter->exportEntityFromRequest($entities,$request); |
|
201 | + return $exporter->exportEntityFromRequest($entities, $request); |
|
202 | 202 | } |
203 | 203 | |
204 | 204 | protected function _exportEntity(NamedDBElement $entity, EntityExporter $exporter, Request $request) |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | $em->persist($part); |
82 | 82 | $em->flush(); |
83 | 83 | $this->addFlash('info', $translator->trans('part.edited_flash')); |
84 | - } elseif ($form->isSubmitted() && ! $form->isValid()) { |
|
84 | + } elseif ($form->isSubmitted() && !$form->isValid()) { |
|
85 | 85 | $this->addFlash('error', $translator->trans('part.edited_flash.invalid')); |
86 | 86 | } |
87 | 87 | |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | $this->addFlash('success', $translator->trans('part.created_flash')); |
122 | 122 | |
123 | 123 | return $this->redirectToRoute('part_edit', ['id' => $new_part->getID()]); |
124 | - } elseif ($form->isSubmitted() && ! $form->isValid()) { |
|
124 | + } elseif ($form->isSubmitted() && !$form->isValid()) { |
|
125 | 125 | $this->addFlash('error', $translator->trans('part.created_flash.invalid')); |
126 | 126 | } |
127 | 127 |