Passed
Push — master ( d7dee9...483d68 )
by Jan
04:53 queued 10s
created
src/Services/LogSystem/LogEntryExtraFormatter.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
                 $str .= '<error>'.$this->translator->trans($key).'</error>: ';
92 92
             }
93 93
             $str .= $value;
94
-            if (! empty($str)) {
94
+            if (!empty($str)) {
95 95
                 $tmp[] = $str;
96 96
             }
97 97
         }
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
                 $str .= '<b>'.$this->translator->trans($key).'</b>: ';
117 117
             }
118 118
             $str .= $value;
119
-            if (! empty($str)) {
119
+            if (!empty($str)) {
120 120
                 $tmp[] = $str;
121 121
             }
122 122
         }
@@ -186,7 +186,7 @@  discard block
 block discarded – undo
186 186
                 '%s <i class="fas fa-long-arrow-alt-right"></i> %s (%s)',
187 187
                 $context->getOldInstock(),
188 188
                 $context->getNewInstock(),
189
-                (! $context->isWithdrawal() ? '+' : '-').$context->getDifference(true)
189
+                (!$context->isWithdrawal() ? '+' : '-').$context->getDifference(true)
190 190
             );
191 191
             $array['log.instock_changed.comment'] = htmlspecialchars($context->getComment());
192 192
         }
Please login to merge, or discard this patch.
src/Services/Parameters/ParameterExtractor.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@
 block discarded – undo
44 44
         }
45 45
 
46 46
         //Restrict search length
47
-        $input = mb_strimwidth($input,0,self::CHAR_LIMIT);
47
+        $input = mb_strimwidth($input, 0, self::CHAR_LIMIT);
48 48
 
49 49
         $parameters = [];
50 50
 
Please login to merge, or discard this patch.
src/Form/AdminPages/BaseEntityAdminForm.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -94,14 +94,14 @@  discard block
 block discarded – undo
94 94
                 'attr' => [
95 95
                     'placeholder' => 'part.name.placeholder',
96 96
                 ],
97
-                'disabled' => ! $this->security->isGranted($is_new ? 'create' : 'edit', $entity),
97
+                'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity),
98 98
             ])
99 99
 
100 100
             ->add('parent', StructuralEntityType::class, [
101 101
                 'class' => get_class($entity),
102 102
                 'required' => false,
103 103
                 'label' => 'parent.label',
104
-                'disabled' => ! $this->security->isGranted($is_new ? 'create' : 'move', $entity),
104
+                'disabled' => !$this->security->isGranted($is_new ? 'create' : 'move', $entity),
105 105
             ])
106 106
 
107 107
             ->add('not_selectable', CheckboxType::class, [
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
                 'label_attr' => [
112 112
                     'class' => 'checkbox-custom',
113 113
                 ],
114
-                'disabled' => ! $this->security->isGranted($is_new ? 'create' : 'edit', $entity),
114
+                'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity),
115 115
             ])
116 116
 
117 117
             ->add('comment', CKEditorType::class, [
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
                     'rows' => 4,
123 123
                 ],
124 124
                 'help' => 'bbcode.hint',
125
-                'disabled' => ! $this->security->isGranted($is_new ? 'create' : 'edit', $entity),
125
+                'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity),
126 126
             ]);
127 127
 
128 128
         $this->additionalFormElements($builder, $options, $entity);
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
             'allow_add' => true,
134 134
             'allow_delete' => true,
135 135
             'label' => false,
136
-            'disabled' => ! $this->security->isGranted($is_new ? 'create' : 'edit', $entity),
136
+            'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity),
137 137
             'entry_options' => [
138 138
                 'data_class' => $options['attachment_class'],
139 139
             ],
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
 
143 143
         $builder->add('master_picture_attachment', MasterPictureAttachmentType::class, [
144 144
             'required' => false,
145
-            'disabled' => ! $this->security->isGranted($is_new ? 'create' : 'edit', $entity),
145
+            'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity),
146 146
             'label' => 'part.edit.master_attachment',
147 147
             'entity' => $entity,
148 148
         ]);
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
             'entry_type' => ParameterType::class,
159 159
             'allow_add' => $this->security->isGranted($is_new ? 'create' : 'edit', $entity),
160 160
             'allow_delete' => $this->security->isGranted($is_new ? 'create' : 'edit', $entity),
161
-            'disabled' => ! $this->security->isGranted($is_new ? 'create' : 'edit', $entity),
161
+            'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity),
162 162
             'label' => false,
163 163
             'by_reference' => false,
164 164
             'prototype_data' => new $options['parameter_class'](),
@@ -173,11 +173,11 @@  discard block
 block discarded – undo
173 173
             'attr' => [
174 174
                 'class' => $is_new ? 'btn-success' : '',
175 175
             ],
176
-            'disabled' => ! $this->security->isGranted($is_new ? 'create' : 'edit', $entity),
176
+            'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity),
177 177
         ])
178 178
             ->add('reset', ResetType::class, [
179 179
                 'label' => 'entity.edit.reset',
180
-                'disabled' => ! $this->security->isGranted($is_new ? 'create' : 'edit', $entity),
180
+                'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity),
181 181
             ]);
182 182
     }
183 183
 
Please login to merge, or discard this patch.
src/Form/Type/CurrencyEntityType.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
         // This options allows you to override the currency shown for the null value
73 73
         $resolver->setDefault('base_currency', null);
74 74
 
75
-        $resolver->setDefault('empty_message', function (Options $options) {
75
+        $resolver->setDefault('empty_message', function(Options $options) {
76 76
             //By default we use the global base currency:
77 77
             $iso_code = $this->base_currency;
78 78
 
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
     {
89 89
         //Similar to StructuralEntityType, but we use the currency symbol instead if available
90 90
 
91
-        if (! $choice instanceof Currency) {
91
+        if (!$choice instanceof Currency) {
92 92
             throw new \InvalidArgumentException('$choice must be an currency object!');
93 93
         }
94 94
 
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
         /** @var Currency $choice */
118 118
         $tmp = [];
119 119
 
120
-        if (! empty($choice->getIsoCode())) {
120
+        if (!empty($choice->getIsoCode())) {
121 121
             //Show the name of the currency
122 122
             $tmp += ['data-subtext' => $choice->getName()];
123 123
         }
Please login to merge, or discard this patch.
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.