Passed
Push — master ( cb547a...2685d5 )
by Jan
12:23 queued 07:26
created
src/EventSubscriber/UserSystem/SetUserTimezoneSubscriber.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -50,12 +50,12 @@
 block discarded – undo
50 50
 
51 51
         //Check if the user has set a timezone
52 52
         $user = $this->security->getUser();
53
-        if ($user instanceof User && ! empty($user->getTimezone())) {
53
+        if ($user instanceof User && !empty($user->getTimezone())) {
54 54
             $timezone = $user->getTimezone();
55 55
         }
56 56
 
57 57
         //Fill with default value if needed
58
-        if (null === $timezone && ! empty($this->default_timezone)) {
58
+        if (null === $timezone && !empty($this->default_timezone)) {
59 59
             $timezone = $this->default_timezone;
60 60
         }
61 61
 
Please login to merge, or discard this patch.
src/EventSubscriber/UserSystem/PasswordChangeNeededSubscriber.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -74,15 +74,15 @@  discard block
 block discarded – undo
74 74
         $user = $this->security->getUser();
75 75
         $request = $event->getRequest();
76 76
 
77
-        if (! $event->isMasterRequest()) {
77
+        if (!$event->isMasterRequest()) {
78 78
             return;
79 79
         }
80
-        if (! $user instanceof User) {
80
+        if (!$user instanceof User) {
81 81
             return;
82 82
         }
83 83
 
84 84
         //Abort if we dont need to redirect the user.
85
-        if (! $user->isNeedPwChange() && ! static::TFARedirectNeeded($user)) {
85
+        if (!$user->isNeedPwChange() && !static::TFARedirectNeeded($user)) {
86 86
             return;
87 87
         }
88 88
 
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
     {
126 126
         $tfa_enabled = $user->isU2FAuthEnabled() || $user->isGoogleAuthenticatorEnabled();
127 127
 
128
-        if (null !== $user->getGroup() && $user->getGroup()->isEnforce2FA() && ! $tfa_enabled) {
128
+        if (null !== $user->getGroup() && $user->getGroup()->isEnforce2FA() && !$tfa_enabled) {
129 129
             return true;
130 130
         }
131 131
 
Please login to merge, or discard this patch.
src/EventSubscriber/UserSystem/RegisterU2FSubscriber.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -80,9 +80,9 @@
 block discarded – undo
80 80
     public function onRegister(RegisterEvent $event): void
81 81
     {
82 82
         //Skip adding of U2F key on demo mode
83
-        if (! $this->demo_mode) {
83
+        if (!$this->demo_mode) {
84 84
             $user = $event->getUser();
85
-            if (! $user instanceof User) {
85
+            if (!$user instanceof User) {
86 86
                 throw new \InvalidArgumentException('Only User objects can be registered for U2F!');
87 87
             }
88 88
 
Please login to merge, or discard this patch.
src/EventSubscriber/LogSystem/EventLoggerSubscriber.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -269,11 +269,11 @@  discard block
 block discarded – undo
269 269
     {
270 270
         unset($fields['lastModified']);
271 271
 
272
-        if (! $this->hasFieldRestrictions($element)) {
272
+        if (!$this->hasFieldRestrictions($element)) {
273 273
             return $fields;
274 274
         }
275 275
 
276
-        return array_filter($fields, function ($value, $key) use ($element) {
276
+        return array_filter($fields, function($value, $key) use ($element) {
277 277
             //Associative array (save changed data) case
278 278
             if (is_string($key)) {
279 279
                 return $this->shouldFieldBeSaved($element, $key);
@@ -287,7 +287,7 @@  discard block
 block discarded – undo
287 287
     {
288 288
         $uow = $em->getUnitOfWork();
289 289
 
290
-        if (! $logEntry instanceof ElementEditedLogEntry && ! $logEntry instanceof ElementDeletedLogEntry) {
290
+        if (!$logEntry instanceof ElementEditedLogEntry && !$logEntry instanceof ElementDeletedLogEntry) {
291 291
             throw new \InvalidArgumentException('$logEntry must be ElementEditedLogEntry or ElementDeletedLogEntry!');
292 292
         }
293 293
 
@@ -300,7 +300,7 @@  discard block
 block discarded – undo
300 300
         $old_data = $this->filterFieldRestrictions($entity, $old_data);
301 301
 
302 302
         //Restrict length of string fields, to save memory...
303
-        $old_data = array_map(function ($value) {
303
+        $old_data = array_map(function($value) {
304 304
             if (is_string($value)) {
305 305
                 return mb_strimwidth($value, 0, self::MAX_STRING_LENGTH, '...');
306 306
             }
@@ -319,7 +319,7 @@  discard block
 block discarded – undo
319 319
     protected function validEntity(object $entity): bool
320 320
     {
321 321
         //Dont log logentries itself!
322
-        if ($entity instanceof AbstractDBElement && ! $entity instanceof AbstractLogEntry) {
322
+        if ($entity instanceof AbstractDBElement && !$entity instanceof AbstractLogEntry) {
323 323
             return true;
324 324
         }
325 325
 
Please login to merge, or discard this patch.
src/Controller/PartController.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -182,7 +182,7 @@  discard block
 block discarded – undo
182 182
             $this->addFlash('info', 'part.edited_flash');
183 183
             //Reload form, so the SIUnitType entries use the new part unit
184 184
             $form = $this->createForm(PartBaseType::class, $part);
185
-        } elseif ($form->isSubmitted() && ! $form->isValid()) {
185
+        } elseif ($form->isSubmitted() && !$form->isValid()) {
186 186
             $this->addFlash('error', 'part.edited_flash.invalid');
187 187
         }
188 188
 
@@ -226,7 +226,7 @@  discard block
 block discarded – undo
226 226
      * @return Response
227 227
      */
228 228
     public function new(Request $request, EntityManagerInterface $em, TranslatorInterface $translator,
229
-        AttachmentSubmitHandler $attachmentSubmitHandler, ?Part $part = null): Response
229
+        AttachmentSubmitHandler $attachmentSubmitHandler, ?Part $part = null) : Response
230 230
     {
231 231
         if (null === $part) {
232 232
             $new_part = new Part();
@@ -304,7 +304,7 @@  discard block
 block discarded – undo
304 304
             return $this->redirectToRoute('part_edit', ['id' => $new_part->getID()]);
305 305
         }
306 306
 
307
-        if ($form->isSubmitted() && ! $form->isValid()) {
307
+        if ($form->isSubmitted() && !$form->isValid()) {
308 308
             $this->addFlash('error', 'part.created_flash.invalid');
309 309
         }
310 310
 
Please login to merge, or discard this patch.
src/Form/CollectionTypeExtension.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -75,7 +75,7 @@
 block discarded – undo
75 75
 
76 76
     public function buildForm(FormBuilderInterface $builder, array $options): void
77 77
     {
78
-        $builder->addEventListener(FormEvents::PRE_SET_DATA, function (FormEvent $event) use ($options): void {
78
+        $builder->addEventListener(FormEvents::PRE_SET_DATA, function(FormEvent $event) use ($options): void {
79 79
             $data = $event->getData();
80 80
             $config = $event->getForm()->getConfig();
81 81
             //If enabled do a reindexing of the collection
Please login to merge, or discard this patch.
src/Form/AttachmentFormType.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
             'required' => false,
107 107
             'label' => 'attachment.edit.secure_file',
108 108
             'mapped' => false,
109
-            'disabled' => ! $this->security->isGranted('@parts_attachments.show_private'),
109
+            'disabled' => !$this->security->isGranted('@parts_attachments.show_private'),
110 110
             'attr' => [
111 111
                 'class' => 'form-control-sm',
112 112
             ],
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
             'required' => false,
135 135
             'label' => 'attachment.edit.download_url',
136 136
             'mapped' => false,
137
-            'disabled' => ! $this->allow_attachments_download,
137
+            'disabled' => !$this->allow_attachments_download,
138 138
             'attr' => [
139 139
                 'class' => 'form-control-sm',
140 140
             ],
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
         //Check the secure file checkbox, if file is in securefile location
164 164
         $builder->get('secureFile')->addEventListener(
165 165
             FormEvents::PRE_SET_DATA,
166
-            function (FormEvent $event): void {
166
+            function(FormEvent $event): void {
167 167
                 $attachment = $event->getForm()->getParent()->getData();
168 168
                 if ($attachment instanceof Attachment) {
169 169
                     $event->setData($attachment->isSecure());
Please login to merge, or discard this patch.
src/Form/Type/StructuralEntityType.php 1 patch
Spacing   +11 added lines, -11 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,21 +94,21 @@  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 (Options $options) {
106
-                return function ($choice, $key, $value) use ($options) {
105
+            'choice_label' => function(Options $options) {
106
+                return function($choice, $key, $value) use ($options) {
107 107
                     return $this->generateChoiceLabels($choice, $key, $value, $options);
108 108
                 };
109 109
             },
110
-            'choice_attr' => function (Options $options) {
111
-                return function ($choice, $key, $value) use ($options) {
110
+            'choice_attr' => function(Options $options) {
111
+                return function($choice, $key, $value) use ($options) {
112 112
                     return $this->generateChoiceAttr($choice, $key, $value, $options);
113 113
                 };
114 114
             },
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
 
118 118
         $resolver->setDefault('empty_message', null);
119 119
 
120
-        $resolver->setDefault('attr', function (Options $options) {
120
+        $resolver->setDefault('attr', function(Options $options) {
121 121
             $tmp = [
122 122
                 'class' => 'selectpicker',
123 123
                 'data-live-search' => true,
Please login to merge, or discard this patch.
src/EventSubscriber/LogSystem/LogAccessDeniedSubscriber.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@
 block discarded – undo
49 49
             $throwable = $throwable->getPrevious();
50 50
         }
51 51
         //Ignore everything except AccessDeniedExceptions
52
-        if (! $throwable instanceof AccessDeniedException) {
52
+        if (!$throwable instanceof AccessDeniedException) {
53 53
             return;
54 54
         }
55 55
 
Please login to merge, or discard this patch.