Passed
Push — master ( 5e6b6f...41df76 )
by Jan
05:20
created
src/Form/Type/StructuralEntityType.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -82,9 +82,9 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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,
Please login to merge, or discard this patch.
src/Form/Part/PartBaseType.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
         ]);
Please login to merge, or discard this patch.
src/Repository/LogEntryRepository.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -171,7 +171,7 @@
 block discarded – undo
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
     /**
Please login to merge, or discard this patch.
src/DataTables/Column/LogEntryTargetColumn.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -98,7 +98,7 @@
 block discarded – undo
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>',
Please login to merge, or discard this patch.
src/Controller/AdminPages/BaseAdminController.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -161,7 +161,7 @@  discard block
 block discarded – undo
161 161
         $form->handleRequest($request);
162 162
         if ($form->isSubmitted() && $form->isValid()) {
163 163
             //Check if we editing a user and if we need to change the password of it
164
-            if ($entity instanceof User && ! empty($form['new_password']->getData())) {
164
+            if ($entity instanceof User && !empty($form['new_password']->getData())) {
165 165
                 $password = $this->passwordEncoder->encodePassword($entity, $form['new_password']->getData());
166 166
                 $entity->setPassword($password);
167 167
                 //By default the user must change the password afterwards
@@ -199,7 +199,7 @@  discard block
 block discarded – undo
199 199
                 'attachment_class' => $this->attachment_class,
200 200
                 'parameter_class' => $this->parameter_class,
201 201
             ]);
202
-        } elseif ($form->isSubmitted() && ! $form->isValid()) {
202
+        } elseif ($form->isSubmitted() && !$form->isValid()) {
203 203
             $this->addFlash('error', 'entity.edit_flash.invalid');
204 204
         }
205 205
 
@@ -229,7 +229,7 @@  discard block
 block discarded – undo
229 229
         $form->handleRequest($request);
230 230
 
231 231
         if ($form->isSubmitted() && $form->isValid()) {
232
-            if ($new_entity instanceof User && ! empty($form['new_password']->getData())) {
232
+            if ($new_entity instanceof User && !empty($form['new_password']->getData())) {
233 233
                 $password = $this->passwordEncoder->encodePassword($new_entity, $form['new_password']->getData());
234 234
                 $new_entity->setPassword($password);
235 235
                 //By default the user must change the password afterwards
@@ -264,7 +264,7 @@  discard block
 block discarded – undo
264 264
             return $this->redirectToRoute($this->route_base.'_edit', ['id' => $new_entity->getID()]);
265 265
         }
266 266
 
267
-        if ($form->isSubmitted() && ! $form->isValid()) {
267
+        if ($form->isSubmitted() && !$form->isValid()) {
268 268
             $this->addFlash('error', 'entity.created_flash.invalid');
269 269
         }
270 270
 
Please login to merge, or discard this patch.
src/Services/EntityURLGenerator.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -381,7 +381,7 @@
 block discarded – undo
381 381
         $class = get_class($entity);
382 382
 
383 383
         //Check if we have an direct mapping for the given class
384
-        if (! array_key_exists($class, $map)) {
384
+        if (!array_key_exists($class, $map)) {
385 385
             //Check if we need to check inheritance by looping through our map
386 386
             foreach (array_keys($map) as $key) {
387 387
                 if (is_a($entity, $key)) {
Please login to merge, or discard this patch.
src/Services/Parameters/ParameterExtractor.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
      */
41 41
     public function extractParameters(string $input, string $class = PartParameter::class): array
42 42
     {
43
-        if (! is_a($class, AbstractParameter::class, true)) {
43
+        if (!is_a($class, AbstractParameter::class, true)) {
44 44
             throw new \InvalidArgumentException('$class must be a child class of AbstractParameter!');
45 45
         }
46 46
 
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
 
69 69
         $matches = [];
70 70
         \preg_match($regex, $input, $matches);
71
-        if (! empty($matches)) {
71
+        if (!empty($matches)) {
72 72
             [, $name, $value] = $matches;
73 73
             $value = trim($value);
74 74
 
Please login to merge, or discard this patch.
tests/Controller/AdminPages/AbstractAdminControllerTest.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
         $client->request('GET', static::$base_path.'/new');
91 91
         $this->assertFalse($client->getResponse()->isRedirect());
92 92
         $this->assertSame($read, $client->getResponse()->isSuccessful(), 'Controller was not successful!');
93
-        $this->assertSame($read, ! $client->getResponse()->isForbidden(), 'Permission Checking not working!');
93
+        $this->assertSame($read, !$client->getResponse()->isForbidden(), 'Permission Checking not working!');
94 94
     }
95 95
 
96 96
     /**
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
         $client->request('GET', static::$base_path.'/1');
116 116
         $this->assertFalse($client->getResponse()->isRedirect());
117 117
         $this->assertSame($read, $client->getResponse()->isSuccessful(), 'Controller was not successful!');
118
-        $this->assertSame($read, ! $client->getResponse()->isForbidden(), 'Permission Checking not working!');
118
+        $this->assertSame($read, !$client->getResponse()->isForbidden(), 'Permission Checking not working!');
119 119
     }
120 120
 
121 121
     public function deleteDataProvider(): array
@@ -152,6 +152,6 @@  discard block
 block discarded – undo
152 152
 
153 153
         //Page is redirected to '/new', when delete was successful
154 154
         $this->assertSame($delete, $client->getResponse()->isRedirect(static::$base_path.'/new'));
155
-        $this->assertSame($delete, ! $client->getResponse()->isForbidden(), 'Permission Checking not working!');
155
+        $this->assertSame($delete, !$client->getResponse()->isForbidden(), 'Permission Checking not working!');
156 156
     }
157 157
 }
Please login to merge, or discard this patch.
src/EventSubscriber/SymfonyDebugToolbarSubscriber.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -81,7 +81,7 @@
 block discarded – undo
81 81
 
82 82
     public function onKernelResponse(ResponseEvent $event): void
83 83
     {
84
-        if (! $this->kernel_debug) {
84
+        if (!$this->kernel_debug) {
85 85
             return;
86 86
         }
87 87
 
Please login to merge, or discard this patch.