Passed
Push — master ( 5c3032...f1c3a5 )
by Jan
08:21
created
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/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/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.
src/Security/Voter/PermissionVoter.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -63,7 +63,7 @@
 block discarded – undo
63 63
             $valid = $this->resolver->isValidOperation($perm, $op);
64 64
 
65 65
             //if an invalid operation is encountered, throw an exception so the developer knows it
66
-            if(!$valid) {
66
+            if (!$valid) {
67 67
                 throw new \RuntimeException('Encountered invalid permission operation "'.$op.'" for permission "'.$perm.'"!');
68 68
             }
69 69
 
Please login to merge, or discard this patch.
src/Security/Voter/AttachmentVoter.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@
 block discarded – undo
52 52
 
53 53
         //If the attachment has no element (which should not happen), we deny access, as we can not determine if the user is allowed to access the associated element
54 54
         $target_element = $subject->getElement();
55
-        if (! $subject instanceof Attachment || null === $target_element) {
55
+        if (!$subject instanceof Attachment || null === $target_element) {
56 56
             return false;
57 57
         }
58 58
 
Please login to merge, or discard this patch.
src/Security/Voter/ParameterVoter.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -112,7 +112,7 @@
 block discarded – undo
112 112
         } elseif ($subject instanceof SupplierParameter) {
113 113
             $param = 'suppliers';
114 114
         } else {
115
-            throw new RuntimeException('Encountered unknown Parameter type: ' . get_class($subject));
115
+            throw new RuntimeException('Encountered unknown Parameter type: '.get_class($subject));
116 116
         }
117 117
 
118 118
         return $this->resolver->inherit($user, $param, $attribute) ?? false;
Please login to merge, or discard this patch.
src/Security/Voter/OrderdetailVoter.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -61,7 +61,7 @@
 block discarded – undo
61 61
 
62 62
     protected function voteOnUser(string $attribute, $subject, User $user): bool
63 63
     {
64
-        if (! is_a($subject, Orderdetail::class, true)) {
64
+        if (!is_a($subject, Orderdetail::class, true)) {
65 65
             throw new \RuntimeException('This voter can only handle Orderdetail objects!');
66 66
         }
67 67
 
Please login to merge, or discard this patch.