Passed
Push — master ( 22c140...6ecc32 )
by Jan
04:53
created
src/Services/Attachments/AttachmentURLGenerator.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -126,11 +126,11 @@
 block discarded – undo
126 126
      */
127 127
     public function getThumbnailURL(Attachment $attachment, string $filter_name = 'thumbnail_sm'): string
128 128
     {
129
-        if (! $attachment->isPicture()) {
129
+        if (!$attachment->isPicture()) {
130 130
             throw new InvalidArgumentException('Thumbnail creation only works for picture attachments!');
131 131
         }
132 132
 
133
-        if ($attachment->isExternal() && ! empty($attachment->getURL())) {
133
+        if ($attachment->isExternal() && !empty($attachment->getURL())) {
134 134
             return $attachment->getURL();
135 135
         }
136 136
 
Please login to merge, or discard this patch.
src/Entity/LogSystem/SecurityEventLogEntry.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@
 block discarded – undo
59 59
 
60 60
     public function setTargetElement(?AbstractDBElement $element): AbstractLogEntry
61 61
     {
62
-        if (! $element instanceof User) {
62
+        if (!$element instanceof User) {
63 63
             throw new \InvalidArgumentException('Target element must be a User object!');
64 64
         }
65 65
 
Please login to merge, or discard this patch.
src/Entity/UserSystem/User.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -508,7 +508,7 @@  discard block
 block discarded – undo
508 508
     {
509 509
         $tmp = $this->getFirstName();
510 510
         //Dont add a space, if the name has only one part (it would look strange)
511
-        if (! empty($this->getFirstName()) && ! empty($this->getLastName())) {
511
+        if (!empty($this->getFirstName()) && !empty($this->getLastName())) {
512 512
             $tmp .= ' ';
513 513
         }
514 514
         $tmp .= $this->getLastName();
@@ -530,7 +530,7 @@  discard block
 block discarded – undo
530 530
     public function setName(string $new_name): AbstractNamedDBElement
531 531
     {
532 532
         // Anonymous user is not allowed to change its username
533
-        if (! $this->isAnonymousUser()) {
533
+        if (!$this->isAnonymousUser()) {
534 534
             $this->name = $new_name;
535 535
         }
536 536
 
Please login to merge, or discard this patch.
src/Controller/AdminPages/LabelProfileController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -95,7 +95,7 @@
 block discarded – undo
95 95
      *
96 96
      * @return Response
97 97
      */
98
-    public function new(Request $request, EntityManagerInterface $em, EntityImporter $importer, ?AttachmentType $entity = null): Response
98
+    public function new(Request $request, EntityManagerInterface $em, EntityImporter $importer, ?AttachmentType $entity = null) : Response
99 99
     {
100 100
         return $this->_new($request, $em, $importer, $entity);
101 101
     }
Please login to merge, or discard this patch.
src/Services/LabelSystem/LabelTextReplacer.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -65,7 +65,7 @@
 block discarded – undo
65 65
     public function replace(string $lines, object $target): string
66 66
     {
67 67
         $patterns = [
68
-            '/(\[\[[A-Z_]+\]\])/' => function ($match) use ($target) {
68
+            '/(\[\[[A-Z_]+\]\])/' => function($match) use ($target) {
69 69
                 return $this->handlePlaceholder($match[0], $target);
70 70
             },
71 71
         ];
Please login to merge, or discard this patch.
src/Form/UserAdminForm.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
                 'attr' => [
96 96
                     'placeholder' => 'user.username.placeholder',
97 97
                 ],
98
-                'disabled' => ! $this->security->isGranted('edit_username', $entity),
98
+                'disabled' => !$this->security->isGranted('edit_username', $entity),
99 99
             ])
100 100
 
101 101
             ->add('group', StructuralEntityType::class, [
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
                 'required' => false,
104 104
                 'label' => 'group.label',
105 105
                 'disable_not_selectable' => true,
106
-                'disabled' => ! $this->security->isGranted('change_group', $entity),
106
+                'disabled' => !$this->security->isGranted('change_group', $entity),
107 107
             ])
108 108
 
109 109
             ->add('first_name', TextType::class, [
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
                     'placeholder' => 'user.firstName.placeholder',
114 114
                 ],
115 115
                 'required' => false,
116
-                'disabled' => ! $this->security->isGranted('edit_infos', $entity),
116
+                'disabled' => !$this->security->isGranted('edit_infos', $entity),
117 117
             ])
118 118
 
119 119
             ->add('last_name', TextType::class, [
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
                     'placeholder' => 'user.lastName.placeholder',
124 124
                 ],
125 125
                 'required' => false,
126
-                'disabled' => ! $this->security->isGranted('edit_infos', $entity),
126
+                'disabled' => !$this->security->isGranted('edit_infos', $entity),
127 127
             ])
128 128
 
129 129
             ->add('email', TextType::class, [
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
                     'placeholder' => 'user.email.placeholder',
134 134
                 ],
135 135
                 'required' => false,
136
-                'disabled' => ! $this->security->isGranted('edit_infos', $entity),
136
+                'disabled' => !$this->security->isGranted('edit_infos', $entity),
137 137
             ])
138 138
 
139 139
             ->add('department', TextType::class, [
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
                     'placeholder' => 'user.department.placeholder',
144 144
                 ],
145 145
                 'required' => false,
146
-                'disabled' => ! $this->security->isGranted('edit_infos', $entity),
146
+                'disabled' => !$this->security->isGranted('edit_infos', $entity),
147 147
             ])
148 148
 
149 149
             //Config section
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
                 'placeholder' => 'user_settings.language.placeholder',
157 157
                 'label' => 'user.language_select',
158 158
                 'preferred_choices' => ['en', 'de'],
159
-                'disabled' => ! $this->security->isGranted('change_user_settings', $entity),
159
+                'disabled' => !$this->security->isGranted('change_user_settings', $entity),
160 160
             ])
161 161
             ->add('timezone', TimezoneType::class, [
162 162
                 'required' => false,
@@ -167,12 +167,12 @@  discard block
 block discarded – undo
167 167
                 'placeholder' => 'user_settings.timezone.placeholder',
168 168
                 'label' => 'user.timezone.label',
169 169
                 'preferred_choices' => ['Europe/Berlin'],
170
-                'disabled' => ! $this->security->isGranted('change_user_settings', $entity),
170
+                'disabled' => !$this->security->isGranted('change_user_settings', $entity),
171 171
             ])
172 172
             ->add('theme', ChoiceType::class, [
173 173
                 'required' => false,
174 174
                 'choices' => User::AVAILABLE_THEMES,
175
-                'choice_label' => function ($entity, $key, $value) {
175
+                'choice_label' => function($entity, $key, $value) {
176 176
                     return $value;
177 177
                 },
178 178
                 'attr' => [
@@ -181,12 +181,12 @@  discard block
 block discarded – undo
181 181
                 'choice_translation_domain' => false,
182 182
                 'placeholder' => 'user_settings.theme.placeholder',
183 183
                 'label' => 'user.theme.label',
184
-                'disabled' => ! $this->security->isGranted('change_user_settings', $entity),
184
+                'disabled' => !$this->security->isGranted('change_user_settings', $entity),
185 185
             ])
186 186
             ->add('currency', CurrencyEntityType::class, [
187 187
                 'required' => false,
188 188
                 'label' => 'user.currency.label',
189
-                'disabled' => ! $this->security->isGranted('change_user_settings', $entity),
189
+                'disabled' => !$this->security->isGranted('change_user_settings', $entity),
190 190
             ])
191 191
 
192 192
             ->add('new_password', RepeatedType::class, [
@@ -200,7 +200,7 @@  discard block
 block discarded – undo
200 200
                 'invalid_message' => 'password_must_match',
201 201
                 'required' => false,
202 202
                 'mapped' => false,
203
-                'disabled' => ! $this->security->isGranted('set_password', $entity),
203
+                'disabled' => !$this->security->isGranted('set_password', $entity),
204 204
                 'constraints' => [new Length([
205 205
                     'min' => 6,
206 206
                     'max' => 128,
@@ -213,7 +213,7 @@  discard block
 block discarded – undo
213 213
                     'class' => 'checkbox-custom',
214 214
                 ],
215 215
                 'label' => 'user.edit.needs_pw_change',
216
-                'disabled' => ! $this->security->isGranted('set_password', $entity),
216
+                'disabled' => !$this->security->isGranted('set_password', $entity),
217 217
             ])
218 218
 
219 219
             ->add('disabled', CheckboxType::class, [
@@ -222,7 +222,7 @@  discard block
 block discarded – undo
222 222
                     'class' => 'checkbox-custom',
223 223
                 ],
224 224
                 'label' => 'user.edit.user_disabled',
225
-                'disabled' => ! $this->security->isGranted('set_password', $entity)
225
+                'disabled' => !$this->security->isGranted('set_password', $entity)
226 226
                     || $entity === $this->security->getUser(),
227 227
             ])
228 228
 
@@ -230,7 +230,7 @@  discard block
 block discarded – undo
230 230
             ->add('permissions', PermissionsType::class, [
231 231
                 'mapped' => false,
232 232
                 'data' => $builder->getData(),
233
-                'disabled' => ! $this->security->isGranted('edit_permissions', $entity),
233
+                'disabled' => !$this->security->isGranted('edit_permissions', $entity),
234 234
             ])
235 235
         ;
236 236
         /*->add('comment', CKEditorType::class, ['required' => false,
@@ -250,7 +250,7 @@  discard block
 block discarded – undo
250 250
                 'data_class' => $options['attachment_class'],
251 251
             ],
252 252
             'by_reference' => false,
253
-            'disabled' => ! $this->security->isGranted($is_new ? 'create' : 'edit', $entity),
253
+            'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity),
254 254
         ]);
255 255
 
256 256
         $builder->add('log_comment', TextType::class, [
Please login to merge, or discard this patch.
tests/Controller/AdminPages/LabelProfileControllerTest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -55,6 +55,6 @@
 block discarded – undo
55 55
 
56 56
         //Page is redirected to '/new', when delete was successful
57 57
         $this->assertSame($delete, $client->getResponse()->isRedirect(static::$base_path.'/new'));
58
-        $this->assertSame($delete, ! $client->getResponse()->isForbidden(), 'Permission Checking not working!');
58
+        $this->assertSame($delete, !$client->getResponse()->isForbidden(), 'Permission Checking not working!');
59 59
     }
60 60
 }
Please login to merge, or discard this patch.
src/Security/Voter/LabelProfileVoter.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@
 block discarded – undo
45 45
     protected function supports($attribute, $subject)
46 46
     {
47 47
         if ($subject instanceof LabelProfile) {
48
-            if (! isset(self::MAPPING[$attribute])) {
48
+            if (!isset(self::MAPPING[$attribute])) {
49 49
                 return false;
50 50
             }
51 51
 
Please login to merge, or discard this patch.
src/Controller/AdminPages/BaseAdminController.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
         if (
177 177
             $entity instanceof LabelProfile
178 178
             && 'twig' === $entity->getOptions()->getLinesMode()
179
-            && ! $this->isGranted('@labels.use_twig')
179
+            && !$this->isGranted('@labels.use_twig')
180 180
         ) {
181 181
             $form_options['disable_options'] = true;
182 182
         }
@@ -186,7 +186,7 @@  discard block
 block discarded – undo
186 186
         $form->handleRequest($request);
187 187
         if ($form->isSubmitted() && $form->isValid()) {
188 188
             //Check if we editing a user and if we need to change the password of it
189
-            if ($entity instanceof User && ! empty($form['new_password']->getData())) {
189
+            if ($entity instanceof User && !empty($form['new_password']->getData())) {
190 190
                 $password = $this->passwordEncoder->encodePassword($entity, $form['new_password']->getData());
191 191
                 $entity->setPassword($password);
192 192
                 //By default the user must change the password afterwards
@@ -227,7 +227,7 @@  discard block
 block discarded – undo
227 227
                 'attachment_class' => $this->attachment_class,
228 228
                 'parameter_class' => $this->parameter_class,
229 229
             ]);
230
-        } elseif ($form->isSubmitted() && ! $form->isValid()) {
230
+        } elseif ($form->isSubmitted() && !$form->isValid()) {
231 231
             $this->addFlash('error', 'entity.edit_flash.invalid');
232 232
         }
233 233
 
@@ -269,7 +269,7 @@  discard block
 block discarded – undo
269 269
         $form->handleRequest($request);
270 270
 
271 271
         if ($form->isSubmitted() && $form->isValid()) {
272
-            if ($new_entity instanceof User && ! empty($form['new_password']->getData())) {
272
+            if ($new_entity instanceof User && !empty($form['new_password']->getData())) {
273 273
                 $password = $this->passwordEncoder->encodePassword($new_entity, $form['new_password']->getData());
274 274
                 $new_entity->setPassword($password);
275 275
                 //By default the user must change the password afterwards
@@ -304,7 +304,7 @@  discard block
 block discarded – undo
304 304
             return $this->redirectToRoute($this->route_base.'_edit', ['id' => $new_entity->getID()]);
305 305
         }
306 306
 
307
-        if ($form->isSubmitted() && ! $form->isValid()) {
307
+        if ($form->isSubmitted() && !$form->isValid()) {
308 308
             $this->addFlash('error', 'entity.created_flash.invalid');
309 309
         }
310 310
 
Please login to merge, or discard this patch.