Passed
Push — master ( f116c2...59f7be )
by Jan
05:45
created
src/Entity/UserSystem/PermissionsEmbed.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -316,7 +316,7 @@  discard block
 block discarded – undo
316 316
      */
317 317
     public function getBitValue(string $permission_name, int $bit_n): int
318 318
     {
319
-        if (! $this->isValidPermissionName($permission_name)) {
319
+        if (!$this->isValidPermissionName($permission_name)) {
320 320
             throw new InvalidArgumentException(sprintf('No permission with the name "%s" is existing!', $permission_name));
321 321
         }
322 322
 
@@ -386,7 +386,7 @@  discard block
 block discarded – undo
386 386
      */
387 387
     public function setBitValue(string $permission_name, int $bit_n, int $new_value): self
388 388
     {
389
-        if (! $this->isValidPermissionName($permission_name)) {
389
+        if (!$this->isValidPermissionName($permission_name)) {
390 390
             throw new InvalidArgumentException('No permission with the given name is existing!');
391 391
         }
392 392
 
@@ -405,7 +405,7 @@  discard block
 block discarded – undo
405 405
      */
406 406
     public function getRawPermissionValue(string $permission_name): int
407 407
     {
408
-        if (! $this->isValidPermissionName($permission_name)) {
408
+        if (!$this->isValidPermissionName($permission_name)) {
409 409
             throw new InvalidArgumentException('No permission with the given name is existing!');
410 410
         }
411 411
 
@@ -422,7 +422,7 @@  discard block
 block discarded – undo
422 422
      */
423 423
     public function setRawPermissionValue(string $permission_name, int $value): self
424 424
     {
425
-        if (! $this->isValidPermissionName($permission_name)) {
425
+        if (!$this->isValidPermissionName($permission_name)) {
426 426
             throw new InvalidArgumentException(sprintf('No permission with the given name %s is existing!', $permission_name));
427 427
         }
428 428
 
@@ -442,7 +442,7 @@  discard block
 block discarded – undo
442 442
      */
443 443
     public function setRawPermissionValues(array $values, ?array $values2 = null): self
444 444
     {
445
-        if (! empty($values2)) {
445
+        if (!empty($values2)) {
446 446
             $values = array_combine($values, $values2);
447 447
         }
448 448
 
Please login to merge, or discard this patch.
src/Entity/Attachments/Attachment.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
             return true;
176 176
         }
177 177
 
178
-        return ! in_array($tmp[0], array_merge(static::INTERNAL_PLACEHOLDER, static::BUILTIN_PLACEHOLDER), false);
178
+        return !in_array($tmp[0], array_merge(static::INTERNAL_PLACEHOLDER, static::BUILTIN_PLACEHOLDER), false);
179 179
     }
180 180
 
181 181
     /**
@@ -226,7 +226,7 @@  discard block
 block discarded – undo
226 226
             return null;
227 227
         }
228 228
 
229
-        if (! empty($this->original_filename)) {
229
+        if (!empty($this->original_filename)) {
230 230
             return strtolower(pathinfo($this->original_filename, PATHINFO_EXTENSION));
231 231
         }
232 232
 
@@ -249,7 +249,7 @@  discard block
 block discarded – undo
249 249
      */
250 250
     public function getURL(): ?string
251 251
     {
252
-        if (! $this->isExternal() && ! $this->isBuiltIn()) {
252
+        if (!$this->isExternal() && !$this->isBuiltIn()) {
253 253
             return null;
254 254
         }
255 255
 
@@ -262,7 +262,7 @@  discard block
 block discarded – undo
262 262
      */
263 263
     public function getHost(): ?string
264 264
     {
265
-        if (! $this->isExternal()) {
265
+        if (!$this->isExternal()) {
266 266
             return null;
267 267
         }
268 268
 
@@ -292,7 +292,7 @@  discard block
 block discarded – undo
292 292
         }
293 293
 
294 294
         //If we have a stored original filename, then use it
295
-        if (! empty($this->original_filename)) {
295
+        if (!empty($this->original_filename)) {
296 296
             return $this->original_filename;
297 297
         }
298 298
 
@@ -367,7 +367,7 @@  discard block
 block discarded – undo
367 367
      */
368 368
     public function setElement(AttachmentContainingDBElement $element): self
369 369
     {
370
-        if (! is_a($element, static::ALLOWED_ELEMENT_CLASS)) {
370
+        if (!is_a($element, static::ALLOWED_ELEMENT_CLASS)) {
371 371
             throw new InvalidArgumentException(sprintf('The element associated with a %s must be a %s!', static::class, static::ALLOWED_ELEMENT_CLASS));
372 372
         }
373 373
 
@@ -409,7 +409,7 @@  discard block
 block discarded – undo
409 409
     public function setURL(?string $url): self
410 410
     {
411 411
         //Only set if the URL is not empty
412
-        if (! empty($url)) {
412
+        if (!empty($url)) {
413 413
             if (false !== strpos($url, '%BASE%') || false !== strpos($url, '%MEDIA%')) {
414 414
                 throw new InvalidArgumentException('You can not reference internal files via the url field! But nice try!');
415 415
             }
@@ -460,7 +460,7 @@  discard block
 block discarded – undo
460 460
         if ($only_http) {   //Check if scheme is HTTPS or HTTP
461 461
             $scheme = parse_url($string, PHP_URL_SCHEME);
462 462
             if ('http' !== $scheme && 'https' !== $scheme) {
463
-                return false;   //All other schemes are not valid.
463
+                return false; //All other schemes are not valid.
464 464
             }
465 465
         }
466 466
         if ($path_required) {
Please login to merge, or discard this patch.
src/DataTables/Column/LocaleDateTimeColumn.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@
 block discarded – undo
41 41
     {
42 42
         if (null === $value) {
43 43
             return $this->options['nullValue'];
44
-        } elseif (! $value instanceof DateTimeInterface) {
44
+        } elseif (!$value instanceof DateTimeInterface) {
45 45
             $value = new DateTime((string) $value);
46 46
         }
47 47
 
Please login to merge, or discard this patch.
src/DataTables/Column/PartAttachmentsColumn.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -60,11 +60,11 @@
 block discarded – undo
60 60
 
61 61
     public function render($value, $context)
62 62
     {
63
-        if (! $context instanceof Part) {
63
+        if (!$context instanceof Part) {
64 64
             throw new RuntimeException('$context must be a Part object!');
65 65
         }
66 66
         $tmp = '';
67
-        $attachments = $context->getAttachments()->filter(function (Attachment $attachment) {
67
+        $attachments = $context->getAttachments()->filter(function(Attachment $attachment) {
68 68
             return $attachment->getShowInTable() && $this->attachmentManager->isFileExisting($attachment);
69 69
         });
70 70
 
Please login to merge, or discard this patch.
src/Controller/AttachmentFileController.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
             throw new RuntimeException('You can not download external attachments!');
57 57
         }
58 58
 
59
-        if (! $helper->isFileExisting($attachment)) {
59
+        if (!$helper->isFileExisting($attachment)) {
60 60
             throw new RuntimeException('The file associated with the attachment is not existing!');
61 61
         }
62 62
 
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
             throw new RuntimeException('You can not download external attachments!');
87 87
         }
88 88
 
89
-        if (! $helper->isFileExisting($attachment)) {
89
+        if (!$helper->isFileExisting($attachment)) {
90 90
             throw new RuntimeException('The file associated with the attachment is not existing!');
91 91
         }
92 92
 
Please login to merge, or discard this patch.
src/Security/EntityListeners/ElementPermissionListener.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
             );
99 99
 
100 100
             //Check if user is allowed to read info, otherwise apply placeholder
101
-            if ((null !== $annotation) && ! $this->isGranted('read', $annotation, $element)) {
101
+            if ((null !== $annotation) && !$this->isGranted('read', $annotation, $element)) {
102 102
                 $property->setAccessible(true);
103 103
                 $value = $annotation->getPlaceholder();
104 104
 
@@ -146,8 +146,8 @@  discard block
 block discarded – undo
146 146
                 $property->setAccessible(true);
147 147
 
148 148
                 //If the user is not allowed to edit or read this property, reset all values.
149
-                if ((! $this->isGranted('read', $annotation, $element)
150
-                    || ! $this->isGranted('edit', $annotation, $element))) {
149
+                if ((!$this->isGranted('read', $annotation, $element)
150
+                    || !$this->isGranted('edit', $annotation, $element))) {
151 151
                     //Set value to old value, so that there a no change to this property
152 152
                     if (isset($old_data[$property->getName()])) {
153 153
                         $property->setValue($element, $old_data[$property->getName()]);
@@ -170,7 +170,7 @@  discard block
 block discarded – undo
170 170
      */
171 171
     protected function isRunningFromCLI()
172 172
     {
173
-        if (empty($_SERVER['REMOTE_ADDR']) && ! isset($_SERVER['HTTP_USER_AGENT']) && count($_SERVER['argv']) > 0) {
173
+        if (empty($_SERVER['REMOTE_ADDR']) && !isset($_SERVER['HTTP_USER_AGENT']) && count($_SERVER['argv']) > 0) {
174 174
             return true;
175 175
         }
176 176
 
@@ -203,7 +203,7 @@  discard block
 block discarded – undo
203 203
         }
204 204
 
205 205
         //Check if we have already have saved the permission, otherwise save it to cache
206
-        if (! isset($this->perm_cache[$mode][get_class($element)][$operation])) {
206
+        if (!isset($this->perm_cache[$mode][get_class($element)][$operation])) {
207 207
             $this->perm_cache[$mode][get_class($element)][$operation] = $this->security->isGranted($operation, $element);
208 208
         }
209 209
 
Please login to merge, or discard this patch.
src/Form/AttachmentFormType.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
             'required' => false,
113 113
             'label' => 'attachment.edit.download_url',
114 114
             'mapped' => false,
115
-            'disabled' => ! $this->allow_attachments_download,
115
+            'disabled' => !$this->allow_attachments_download,
116 116
             'attr' => [
117 117
                 'class' => 'form-control-sm',
118 118
             ],
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
         //Check the secure file checkbox, if file is in securefile location
142 142
         $builder->get('secureFile')->addEventListener(
143 143
             FormEvents::PRE_SET_DATA,
144
-            function (FormEvent $event): void {
144
+            function(FormEvent $event): void {
145 145
                 $attachment = $event->getForm()->getParent()->getData();
146 146
                 if ($attachment instanceof Attachment) {
147 147
                     $event->setData($attachment->isSecure());
Please login to merge, or discard this patch.
src/Form/AdminPages/CategoryAdminForm.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
             'label_attr' => [
43 43
                 'class' => 'checkbox-custom',
44 44
             ],
45
-            'disabled' => ! $this->security->isGranted($is_new ? 'create' : 'edit', $entity),
45
+            'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity),
46 46
         ]);
47 47
 
48 48
         $builder->add('disable_manufacturers', CheckboxType::class, [
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
             'label_attr' => [
53 53
                 'class' => 'checkbox-custom',
54 54
             ],
55
-            'disabled' => ! $this->security->isGranted($is_new ? 'create' : 'edit', $entity),
55
+            'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity),
56 56
         ]);
57 57
 
58 58
         $builder->add('disable_autodatasheets', CheckboxType::class, [
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
             'label_attr' => [
63 63
                 'class' => 'checkbox-custom',
64 64
             ],
65
-            'disabled' => ! $this->security->isGranted($is_new ? 'create' : 'edit', $entity),
65
+            'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity),
66 66
         ]);
67 67
 
68 68
         $builder->add('disable_properties', CheckboxType::class, [
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
             'label_attr' => [
73 73
                 'class' => 'checkbox-custom',
74 74
             ],
75
-            'disabled' => ! $this->security->isGranted($is_new ? 'create' : 'edit', $entity),
75
+            'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity),
76 76
         ]);
77 77
 
78 78
         $builder->add('partname_hint', TextType::class, [
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
             'attr' => [
83 83
                 'placeholder' => 'category.edit.partname_hint.placeholder',
84 84
             ],
85
-            'disabled' => ! $this->security->isGranted($is_new ? 'create' : 'edit', $entity),
85
+            'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity),
86 86
         ]);
87 87
 
88 88
         $builder->add('partname_regex', TextType::class, [
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
             'attr' => [
93 93
                 'placeholder' => 'category.edit.partname_regex.placeholder',
94 94
             ],
95
-            'disabled' => ! $this->security->isGranted($is_new ? 'create' : 'edit', $entity),
95
+            'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity),
96 96
         ]);
97 97
 
98 98
         $builder->add('default_description', TextType::class, [
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
             'attr' => [
103 103
                 'placeholder' => 'category.edit.default_description.placeholder',
104 104
             ],
105
-            'disabled' => ! $this->security->isGranted($is_new ? 'create' : 'edit', $entity),
105
+            'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity),
106 106
         ]);
107 107
 
108 108
         $builder->add('default_comment', TextType::class, [
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
             'attr' => [
113 113
                 'placeholder' => 'category.edit.default_comment.placeholder',
114 114
             ],
115
-            'disabled' => ! $this->security->isGranted($is_new ? 'create' : 'edit', $entity),
115
+            'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity),
116 116
         ]);
117 117
     }
118 118
 }
Please login to merge, or discard this patch.
src/Form/AdminPages/SupplierForm.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
             'required' => false,
44 44
             'label' => 'supplier.edit.default_currency',
45 45
             'disable_not_selectable' => true,
46
-            'disabled' => ! $this->security->isGranted($is_new ? 'create' : 'move', $entity),
46
+            'disabled' => !$this->security->isGranted($is_new ? 'create' : 'move', $entity),
47 47
         ]);
48 48
 
49 49
         $builder->add('shipping_costs', MoneyType::class, [
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
             'currency' => $this->params->get('default_currency'),
52 52
             'scale' => 3,
53 53
             'label' => 'supplier.shipping_costs.label',
54
-            'disabled' => ! $this->security->isGranted($is_new ? 'create' : 'move', $entity),
54
+            'disabled' => !$this->security->isGranted($is_new ? 'create' : 'move', $entity),
55 55
         ]);
56 56
     }
57 57
 }
Please login to merge, or discard this patch.