Passed
Push — master ( b9ce1d...ff89b6 )
by Jan
16:14
created
src/EntityListeners/TreeCacheInvalidationListener.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -57,7 +57,7 @@
 block discarded – undo
57 57
             $this->cache->invalidateTags([$secure_class_name]);
58 58
 
59 59
             //Trigger a sidebar reload for all users (see SidebarTreeUpdater service)
60
-            if(!$element instanceof LabelProfile) {
60
+            if (!$element instanceof LabelProfile) {
61 61
                 $this->cache->invalidateTags(['sidebar_tree_update']);
62 62
             }
63 63
         }
Please login to merge, or discard this patch.
src/Form/ProjectSystem/ProjectBOMEntryType.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@
 block discarded – undo
26 26
     {
27 27
 
28 28
 
29
-        $builder->addEventListener(FormEvents::PRE_SET_DATA, function (PreSetDataEvent $event) {
29
+        $builder->addEventListener(FormEvents::PRE_SET_DATA, function(PreSetDataEvent $event) {
30 30
             $form = $event->getForm();
31 31
             /** @var ProjectBOMEntry $data */
32 32
             $data = $event->getData();
Please login to merge, or discard this patch.
src/Form/Type/MasterPictureAttachmentType.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -46,8 +46,8 @@  discard block
 block discarded – undo
46 46
                 'data-controller' => 'elements--selectpicker',
47 47
                 'title' => 'selectpicker.nothing_selected',
48 48
             ],
49
-            'choice_attr' => static function (Options $options) {
50
-                return  static function ($choice, $key, $value) use ($options) {
49
+            'choice_attr' => static function(Options $options) {
50
+                return  static function($choice, $key, $value) use ($options) {
51 51
                     /** @var Attachment $choice */
52 52
                     $tmp = ['data-subtext' => $choice->getFilename() ?? 'URL'];
53 53
 
@@ -61,9 +61,9 @@  discard block
 block discarded – undo
61 61
                 };
62 62
             },
63 63
             'choice_label' => 'name',
64
-            'choice_loader' => static function (Options $options) {
64
+            'choice_loader' => static function(Options $options) {
65 65
                 return new CallbackChoiceLoader(
66
-                    static function () use ($options) {
66
+                    static function() use ($options) {
67 67
                         $entity = $options['entity'];
68 68
                         if (!$entity instanceof AttachmentContainingDBElement) {
69 69
                             throw new RuntimeException('$entity must have Attachments! (be of type AttachmentContainingDBElement)');
Please login to merge, or discard this patch.
src/Form/Type/CurrencyEntityType.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
         // This options allows you to override the currency shown for the null value
58 58
         $resolver->setDefault('base_currency', null);
59 59
 
60
-        $resolver->setDefault('empty_message', function (Options $options) {
60
+        $resolver->setDefault('empty_message', function(Options $options) {
61 61
             //By default we use the global base currency:
62 62
             $iso_code = $this->base_currency;
63 63
 
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
 
77 77
     protected function getChoiceContent(AbstractStructuralDBElement $choice, $key, $value, $options): string
78 78
     {
79
-        if(!$choice instanceof Currency) {
79
+        if (!$choice instanceof Currency) {
80 80
             throw new RuntimeException('$choice must be an instance of Currency!');
81 81
         }
82 82
 
@@ -93,10 +93,10 @@  discard block
 block discarded – undo
93 93
         $tmp = str_repeat('<span class="picker-level"></span>', $level);
94 94
 
95 95
         //Show currency symbol or ISO code and the name of the currency
96
-        if(!empty($choice->getIsoCode())) {
96
+        if (!empty($choice->getIsoCode())) {
97 97
             $tmp .= Currencies::getSymbol($choice->getIsoCode());
98 98
             //Add currency name as badge
99
-            $tmp .= sprintf('<span class="badge bg-primary ms-2 %s">%s</span>', $options['short'] ? 'picker-hs' : '' , htmlspecialchars($choice->getName()));
99
+            $tmp .= sprintf('<span class="badge bg-primary ms-2 %s">%s</span>', $options['short'] ? 'picker-hs' : '', htmlspecialchars($choice->getName()));
100 100
         } else {
101 101
             $tmp .= htmlspecialchars($choice->getName());
102 102
         }
Please login to merge, or discard this patch.
src/Form/Type/PartSelectType.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
     public function buildForm(FormBuilderInterface $builder, array $options)
37 37
     {
38 38
         //At initialization we have to fill the form element with our selected data, so the user can see it
39
-        $builder->addEventListener(FormEvents::PRE_SET_DATA, function (PreSetDataEvent $event) {
39
+        $builder->addEventListener(FormEvents::PRE_SET_DATA, function(PreSetDataEvent $event) {
40 40
             $form = $event->getForm();
41 41
             $config = $form->getConfig()->getOptions();
42 42
             $data = $event->getData() ?? [];
@@ -95,8 +95,8 @@  discard block
 block discarded – undo
95 95
 
96 96
         $resolver->setDefaults([
97 97
             //Prefill the selected choice with the needed data, so the user can see it without an additional Ajax request
98
-            'choice_attr' => ChoiceList::attr($this, function (?Part $part) {
99
-                if($part) {
98
+            'choice_attr' => ChoiceList::attr($this, function(?Part $part) {
99
+                if ($part) {
100 100
                     //Determine the picture to show:
101 101
                     $preview_attachment = $this->previewGenerator->getTablePreviewAttachment($part);
102 102
                     if ($preview_attachment !== null) {
Please login to merge, or discard this patch.
src/Form/Type/StructuralEntityType.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -59,9 +59,9 @@  discard block
 block discarded – undo
59 59
     public function buildForm(FormBuilderInterface $builder, array $options): void
60 60
     {
61 61
         $builder->addModelTransformer(new CallbackTransformer(
62
-                                          function ($value) use ($options) {
62
+                                          function($value) use ($options) {
63 63
                                               return $this->transform($value, $options);
64
-                                          }, function ($value) use ($options) {
64
+                                          }, function($value) use ($options) {
65 65
                                               return $this->reverseTransform($value, $options);
66 66
                                           }));
67 67
     }
@@ -71,21 +71,21 @@  discard block
 block discarded – undo
71 71
         $resolver->setRequired(['class']);
72 72
         $resolver->setDefaults([
73 73
             'show_fullpath_in_subtext' => true, //When this is enabled, the full path will be shown in subtext
74
-            'subentities_of' => null,   //Only show entities with the given parent class
75
-            'disable_not_selectable' => false,  //Disable entries with not selectable property
74
+            'subentities_of' => null, //Only show entities with the given parent class
75
+            'disable_not_selectable' => false, //Disable entries with not selectable property
76 76
             'choice_value' => 'id', //Use the element id as option value and for comparing items
77
-            'choice_loader' => function (Options $options) {
78
-                return new CallbackChoiceLoader(function () use ($options) {
77
+            'choice_loader' => function(Options $options) {
78
+                return new CallbackChoiceLoader(function() use ($options) {
79 79
                     return $this->getEntries($options);
80 80
                 });
81 81
             },
82
-            'choice_label' => function (Options $options) {
83
-                return function ($choice, $key, $value) use ($options) {
82
+            'choice_label' => function(Options $options) {
83
+                return function($choice, $key, $value) use ($options) {
84 84
                     return $this->generateChoiceLabels($choice, $key, $value, $options);
85 85
                 };
86 86
             },
87
-            'choice_attr' => function (Options $options) {
88
-                return function ($choice, $key, $value) use ($options) {
87
+            'choice_attr' => function(Options $options) {
88
+                return function($choice, $key, $value) use ($options) {
89 89
                     return $this->generateChoiceAttr($choice, $key, $value, $options);
90 90
                 };
91 91
             },
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
 
97 97
         $resolver->setDefault('controller', 'elements--selectpicker');
98 98
 
99
-        $resolver->setDefault('attr', static function (Options $options) {
99
+        $resolver->setDefault('attr', static function(Options $options) {
100 100
             $tmp = [
101 101
                 'data-controller' => $options['controller'],
102 102
                 'data-live-search' => true,
@@ -233,11 +233,11 @@  discard block
 block discarded – undo
233 233
         $html .= $this->getElementNameWithLevelWhitespace($choice, $options, '<span class="picker-level"></span>');
234 234
 
235 235
         if ($options['show_fullpath_in_subtext'] && null !== $choice->getParent()) {
236
-            $html .= '<span class="ms-3 badge rounded-pill bg-secondary float-end picker-us"><i class="fa-solid fa-folder-tree"></i>&nbsp;' . trim(htmlspecialchars($choice->getParent()->getFullPath())) . '</span>';
236
+            $html .= '<span class="ms-3 badge rounded-pill bg-secondary float-end picker-us"><i class="fa-solid fa-folder-tree"></i>&nbsp;'.trim(htmlspecialchars($choice->getParent()->getFullPath())).'</span>';
237 237
         }
238 238
 
239 239
         if ($choice instanceof AttachmentType && !empty($choice->getFiletypeFilter())) {
240
-            $html .= '<span class="ms-3 badge bg-warning"><i class="fa-solid fa-file-circle-exclamation"></i>&nbsp;' . trim(htmlspecialchars($choice->getFiletypeFilter())) . '</span>';
240
+            $html .= '<span class="ms-3 badge bg-warning"><i class="fa-solid fa-file-circle-exclamation"></i>&nbsp;'.trim(htmlspecialchars($choice->getFiletypeFilter())).'</span>';
241 241
         }
242 242
 
243 243
         return $html;
Please login to merge, or discard this patch.
src/Form/Permissions/PermissionsType.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@
 block discarded – undo
47 47
         $resolver->setDefaults([
48 48
             'show_legend' => true,
49 49
             'show_presets' => false,
50
-            'constraints' => static function (Options $options) {
50
+            'constraints' => static function(Options $options) {
51 51
                 if (!$options['disabled']) {
52 52
                     return [new NoLockout()];
53 53
                 }
Please login to merge, or discard this patch.
src/Form/Filters/Constraints/ParameterValueConstraintType.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@
 block discarded – undo
22 22
 
23 23
 class ParameterValueConstraintType extends NumberConstraintType
24 24
 {
25
-    protected const CHOICES =  [
25
+    protected const CHOICES = [
26 26
         '' => '',
27 27
         'filter.parameter_value_constraint.operator.=' => '=',
28 28
         'filter.parameter_value_constraint.operator.!=' => '!=',
Please login to merge, or discard this patch.
src/Form/Filters/Constraints/ParameterConstraintType.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
 
58 58
         $builder->add('value_text', TextConstraintType::class, [
59 59
             //'required' => false,
60
-        ] );
60
+        ]);
61 61
 
62 62
         $builder->add('value', ParameterValueConstraintType::class, [
63 63
         ]);
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
          * arguments.
69 69
          * Ensure that the data is never null, but use an empty ParameterConstraint instead
70 70
          */
71
-        $builder->addEventListener(FormEvents::PRE_SET_DATA, function (FormEvent $event) {
71
+        $builder->addEventListener(FormEvents::PRE_SET_DATA, function(FormEvent $event) {
72 72
             $form = $event->getForm();
73 73
             $data = $event->getData();
74 74
 
Please login to merge, or discard this patch.