Passed
Branch master (350f1b)
by Jan
04:53
created
src/Form/LabelSystem/LabelDialogType.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@
 block discarded – undo
54 54
 
55 55
         $builder->add('options', LabelOptionsType::class, [
56 56
             'label' => false,
57
-            'disabled' => ! $this->security->isGranted('@labels.edit_options') || $options['disable_options'],
57
+            'disabled' => !$this->security->isGranted('@labels.edit_options') || $options['disable_options'],
58 58
         ]);
59 59
         $builder->add('update', SubmitType::class, [
60 60
             'label' => 'label_generator.update',
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,7 +94,7 @@  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
         if ($entity instanceof AbstractStructuralDBElement) {
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
                     'class' => get_class($entity),
106 106
                     'required' => false,
107 107
                     'label' => 'parent.label',
108
-                    'disabled' => ! $this->security->isGranted($is_new ? 'create' : 'move', $entity),
108
+                    'disabled' => !$this->security->isGranted($is_new ? 'create' : 'move', $entity),
109 109
                 ]
110 110
             )
111 111
                 ->add(
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
                         'label_attr' => [
119 119
                             'class' => 'checkbox-custom',
120 120
                         ],
121
-                        'disabled' => ! $this->security->isGranted($is_new ? 'create' : 'edit', $entity),
121
+                        'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity),
122 122
                     ]
123 123
                 );
124 124
         }
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
                         'rows' => 4,
135 135
                     ],
136 136
                     'help' => 'bbcode.hint',
137
-                    'disabled' => ! $this->security->isGranted($is_new ? 'create' : 'edit', $entity),
137
+                    'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity),
138 138
                 ]
139 139
             );
140 140
         }
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
             'allow_delete' => true,
149 149
             'label' => false,
150 150
             'reindex_enable' => true,
151
-            'disabled' => ! $this->security->isGranted($is_new ? 'create' : 'edit', $entity),
151
+            'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity),
152 152
             'entry_options' => [
153 153
                 'data_class' => $options['attachment_class'],
154 154
             ],
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
 
158 158
         $builder->add('master_picture_attachment', MasterPictureAttachmentType::class, [
159 159
             'required' => false,
160
-            'disabled' => ! $this->security->isGranted($is_new ? 'create' : 'edit', $entity),
160
+            'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity),
161 161
             'label' => 'part.edit.master_attachment',
162 162
             'entity' => $entity,
163 163
         ]);
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
                     'entry_type' => ParameterType::class,
178 178
                     'allow_add' => $this->security->isGranted($is_new ? 'create' : 'edit', $entity),
179 179
                     'allow_delete' => $this->security->isGranted($is_new ? 'create' : 'edit', $entity),
180
-                    'disabled' => ! $this->security->isGranted($is_new ? 'create' : 'edit', $entity),
180
+                    'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity),
181 181
                     'reindex_enable' => true,
182 182
                     'label' => false,
183 183
                     'by_reference' => false,
@@ -195,11 +195,11 @@  discard block
 block discarded – undo
195 195
             'attr' => [
196 196
                 'class' => $is_new ? 'btn-success' : '',
197 197
             ],
198
-            'disabled' => ! $this->security->isGranted($is_new ? 'create' : 'edit', $entity),
198
+            'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity),
199 199
         ])
200 200
             ->add('reset', ResetType::class, [
201 201
                 'label' => 'entity.edit.reset',
202
-                'disabled' => ! $this->security->isGranted($is_new ? 'create' : 'edit', $entity),
202
+                'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity),
203 203
             ]);
204 204
     }
205 205
 
Please login to merge, or discard this patch.
src/Repository/LabelProfileRepository.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
      */
38 38
     public function getDropdownProfiles(string $type): array
39 39
     {
40
-        if (! in_array($type, LabelOptions::SUPPORTED_ELEMENTS, true)) {
40
+        if (!in_array($type, LabelOptions::SUPPORTED_ELEMENTS, true)) {
41 41
             throw new \InvalidArgumentException('Invalid supported_element type given.');
42 42
         }
43 43
 
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
                 $type_children[] = $node;
65 65
             }
66 66
 
67
-            if (! empty($type_children)) {
67
+            if (!empty($type_children)) {
68 68
                 //Use default label e.g. 'part_label'. $$ marks that it will be translated in TreeViewGenerator
69 69
                 $tmp = new TreeViewNode('$$'.$type.'.label', null, $type_children);
70 70
 
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
      */
86 86
     public function findForSupportedElement(string $type, array $order_by = ['name' => 'ASC']): array
87 87
     {
88
-        if (! in_array($type, LabelOptions::SUPPORTED_ELEMENTS, true)) {
88
+        if (!in_array($type, LabelOptions::SUPPORTED_ELEMENTS, true)) {
89 89
             throw new \InvalidArgumentException('Invalid supported_element type given.');
90 90
         }
91 91
 
Please login to merge, or discard this patch.
src/Twig/Sandbox/InheritanceSecurityPolicy.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
     {
61 61
         $this->allowedMethods = [];
62 62
         foreach ($methods as $class => $m) {
63
-            $this->allowedMethods[$class] = array_map(function ($value) { return strtr($value, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz'); }, \is_array($m) ? $m : [$m]);
63
+            $this->allowedMethods[$class] = array_map(function($value) { return strtr($value, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz'); }, \is_array($m) ? $m : [$m]);
64 64
         }
65 65
     }
66 66
 
@@ -77,19 +77,19 @@  discard block
 block discarded – undo
77 77
     public function checkSecurity($tags, $filters, $functions): void
78 78
     {
79 79
         foreach ($tags as $tag) {
80
-            if (! \in_array($tag, $this->allowedTags, true)) {
80
+            if (!\in_array($tag, $this->allowedTags, true)) {
81 81
                 throw new SecurityNotAllowedTagError(sprintf('Tag "%s" is not allowed.', $tag), $tag);
82 82
             }
83 83
         }
84 84
 
85 85
         foreach ($filters as $filter) {
86
-            if (! \in_array($filter, $this->allowedFilters, true)) {
86
+            if (!\in_array($filter, $this->allowedFilters, true)) {
87 87
                 throw new SecurityNotAllowedFilterError(sprintf('Filter "%s" is not allowed.', $filter), $filter);
88 88
             }
89 89
         }
90 90
 
91 91
         foreach ($functions as $function) {
92
-            if (! \in_array($function, $this->allowedFunctions, true)) {
92
+            if (!\in_array($function, $this->allowedFunctions, true)) {
93 93
                 throw new SecurityNotAllowedFunctionError(sprintf('Function "%s" is not allowed.', $function), $function);
94 94
             }
95 95
         }
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
             }
115 115
         }
116 116
 
117
-        if (! $allowed) {
117
+        if (!$allowed) {
118 118
             $class = \get_class($obj);
119 119
 
120 120
             throw new SecurityNotAllowedMethodError(sprintf('Calling "%s" method on a "%s" object is not allowed.', $method, $class), $class, $method);
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
             }
136 136
         }
137 137
 
138
-        if (! $allowed) {
138
+        if (!$allowed) {
139 139
             $class = \get_class($obj);
140 140
 
141 141
             throw new SecurityNotAllowedPropertyError(sprintf('Calling "%s" property on a "%s" object is not allowed.', $property, $class), $class, $property);
Please login to merge, or discard this patch.
src/Helpers/LabelResponse.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -90,7 +90,7 @@
 block discarded – undo
90 90
      */
91 91
     public function setContentDisposition($disposition, $filename, $filenameFallback = '')
92 92
     {
93
-        if ('' === $filenameFallback && (! preg_match('/^[\x20-\x7e]*$/', $filename) || false !== strpos($filename, '%'))) {
93
+        if ('' === $filenameFallback && (!preg_match('/^[\x20-\x7e]*$/', $filename) || false !== strpos($filename, '%'))) {
94 94
             $encoding = mb_detect_encoding($filename, null, true) ?: '8bit';
95 95
 
96 96
             for ($i = 0, $filenameLength = mb_strlen($filename, $encoding); $i < $filenameLength; ++$i) {
Please login to merge, or discard this patch.
src/Form/Type/MasterPictureAttachmentType.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -65,14 +65,14 @@  discard block
 block discarded – undo
65 65
                 'class' => 'selectpicker',
66 66
                 'title' => 'selectpicker.nothing_selected',
67 67
             ],
68
-            'choice_attr' => function (Options $options) {
69
-                return  function ($choice, $key, $value) use ($options) {
68
+            'choice_attr' => function(Options $options) {
69
+                return  function($choice, $key, $value) use ($options) {
70 70
                     /** @var Attachment $choice */
71 71
                     $tmp = ['data-subtext' => $choice->getFilename() ?? 'URL'];
72 72
 
73
-                    if ('picture' === $options['filter'] && ! $choice->isPicture()) {
73
+                    if ('picture' === $options['filter'] && !$choice->isPicture()) {
74 74
                         $tmp += ['disabled' => 'disabled'];
75
-                    } elseif ('3d_model' === $options['filter'] && ! $choice->is3DModel()) {
75
+                    } elseif ('3d_model' === $options['filter'] && !$choice->is3DModel()) {
76 76
                         $tmp += ['disabled' => 'disabled'];
77 77
                     }
78 78
 
@@ -80,10 +80,10 @@  discard block
 block discarded – undo
80 80
                 };
81 81
             },
82 82
             'choice_label' => 'name',
83
-            'choice_loader' => function (Options $options) {
84
-                return new CallbackChoiceLoader(function () use ($options) {
83
+            'choice_loader' => function(Options $options) {
84
+                return new CallbackChoiceLoader(function() use ($options) {
85 85
                     $entity = $options['entity'];
86
-                    if (! $entity instanceof AttachmentContainingDBElement) {
86
+                    if (!$entity instanceof AttachmentContainingDBElement) {
87 87
                         throw new \RuntimeException('$entity must have Attachments! (be of type AttachmentContainingDBElement)');
88 88
                     }
89 89
 
Please login to merge, or discard this patch.
src/Form/UserSettingsType.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -72,27 +72,27 @@  discard block
 block discarded – undo
72 72
         $builder
73 73
             ->add('name', TextType::class, [
74 74
                 'label' => 'user.username.label',
75
-                'disabled' => ! $this->security->isGranted('edit_username', $options['data']) || $this->demo_mode,
75
+                'disabled' => !$this->security->isGranted('edit_username', $options['data']) || $this->demo_mode,
76 76
             ])
77 77
             ->add('first_name', TextType::class, [
78 78
                 'required' => false,
79 79
                 'label' => 'user.firstName.label',
80
-                'disabled' => ! $this->security->isGranted('edit_infos', $options['data']) || $this->demo_mode,
80
+                'disabled' => !$this->security->isGranted('edit_infos', $options['data']) || $this->demo_mode,
81 81
             ])
82 82
             ->add('last_name', TextType::class, [
83 83
                 'required' => false,
84 84
                 'label' => 'user.lastName.label',
85
-                'disabled' => ! $this->security->isGranted('edit_infos', $options['data']) || $this->demo_mode,
85
+                'disabled' => !$this->security->isGranted('edit_infos', $options['data']) || $this->demo_mode,
86 86
             ])
87 87
             ->add('department', TextType::class, [
88 88
                 'required' => false,
89 89
                 'label' => 'user.department.label',
90
-                'disabled' => ! $this->security->isGranted('edit_infos', $options['data']) || $this->demo_mode,
90
+                'disabled' => !$this->security->isGranted('edit_infos', $options['data']) || $this->demo_mode,
91 91
             ])
92 92
             ->add('email', EmailType::class, [
93 93
                 'required' => false,
94 94
                 'label' => 'user.email.label',
95
-                'disabled' => ! $this->security->isGranted('edit_infos', $options['data']) || $this->demo_mode,
95
+                'disabled' => !$this->security->isGranted('edit_infos', $options['data']) || $this->demo_mode,
96 96
             ])
97 97
             ->add('language', LanguageType::class, [
98 98
                 'disabled' => $this->demo_mode,
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
                 ],
125 125
                 'choice_translation_domain' => false,
126 126
                 'choices' => User::AVAILABLE_THEMES,
127
-                'choice_label' => function ($entity, $key, $value) {
127
+                'choice_label' => function($entity, $key, $value) {
128 128
                     return $value;
129 129
                 },
130 130
                 'placeholder' => 'user_settings.theme.placeholder',
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
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
             'required' => false,
71 71
             'label' => 'supplier.edit.default_currency',
72 72
             'disable_not_selectable' => true,
73
-            'disabled' => ! $this->security->isGranted($is_new ? 'create' : 'move', $entity),
73
+            'disabled' => !$this->security->isGranted($is_new ? 'create' : 'move', $entity),
74 74
         ]);
75 75
 
76 76
         $builder->add('shipping_costs', MoneyType::class, [
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
             'currency' => $this->default_currency,
79 79
             'scale' => 3,
80 80
             'label' => 'supplier.shipping_costs.label',
81
-            'disabled' => ! $this->security->isGranted($is_new ? 'create' : 'move', $entity),
81
+            'disabled' => !$this->security->isGranted($is_new ? 'create' : 'move', $entity),
82 82
         ]);
83 83
     }
84 84
 }
Please login to merge, or discard this patch.
src/Form/AdminPages/CurrencyAdminForm.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
                 'title' => 'selectpicker.nothing_selected',
72 72
                 'data-live-search' => true,
73 73
             ],
74
-            'disabled' => ! $this->security->isGranted($is_new ? 'create' : 'edit', $entity),
74
+            'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity),
75 75
         ]);
76 76
 
77 77
         $builder->add('exchange_rate', MoneyType::class, [
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
             'label' => 'currency.edit.exchange_rate',
80 80
             'currency' => $this->default_currency,
81 81
             'scale' => 6,
82
-            'disabled' => ! $this->security->isGranted($is_new ? 'create' : 'edit', $entity),
82
+            'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity),
83 83
         ]);
84 84
     }
85 85
 }
Please login to merge, or discard this patch.