Passed
Push — master ( 01c19a...73ac4f )
by Jan
04:29
created
src/Services/LogSystem/TimeTravel.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
      */
80 80
     public function revertEntityToTimestamp(AbstractDBElement $element, \DateTime $timestamp, array $reverted_elements = []): void
81 81
     {
82
-        if (! $element instanceof TimeStampableInterface) {
82
+        if (!$element instanceof TimeStampableInterface) {
83 83
             throw new \InvalidArgumentException('$element must have a Timestamp!');
84 84
         }
85 85
 
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
                 foreach ($target_elements as $target_element) {
154 154
                     if (null !== $target_element && $element->getLastModified() >= $timestamp) {
155 155
                         //Remove the element from collection, if it did not existed at $timestamp
156
-                        if (! $this->repo->getElementExistedAtTimestamp($target_element, $timestamp)) {
156
+                        if (!$this->repo->getElementExistedAtTimestamp($target_element, $timestamp)) {
157 157
                             if ($target_elements instanceof Collection) {
158 158
                                 $target_elements->removeElement($target_element);
159 159
                             }
@@ -173,10 +173,10 @@  discard block
 block discarded – undo
173 173
     public function applyEntry(AbstractDBElement $element, TimeTravelInterface $logEntry): void
174 174
     {
175 175
         //Skip if this does not provide any info...
176
-        if (! $logEntry->hasOldDataInformations()) {
176
+        if (!$logEntry->hasOldDataInformations()) {
177 177
             return;
178 178
         }
179
-        if (! $element instanceof TimeStampableInterface) {
179
+        if (!$element instanceof TimeStampableInterface) {
180 180
             return;
181 181
         }
182 182
         $metadata = $this->em->getClassMetadata(get_class($element));
Please login to merge, or discard this patch.
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/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/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/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.