PedroTroller / PhpCSFixer-Custom-Fixers

A set of new fixers for PHP-CS-Fixer
77 stars 7 forks source link

Can no longer use phpdoc multine in constructor with since 2.32.3 #205

Open tyx opened 9 months ago

tyx commented 9 months ago

We use this kind of config :

'PedroTroller/line_break_between_method_arguments' => ['max-args' => false, 'max-length' => 120, 'automatic-argument-merge' => false, 'inline-attributes' => false],

Ans since latest release, it want to move inline all our phpdoc

      ---------- begin diff ----------
--- /var/task/src/Operation/Reception/Domain/ReadModel/GuestInformation.php
+++ /var/task/src/Operation/Reception/Domain/ReadModel/GuestInformation.php
@@ -9,8 +9,7 @@
         public int $nbAdults,
         public int $nbChildren,
         public int $nbBabies,
-        /** @var array<AdditionalGuest> $additionalGuests */ 
-        public array $additionalGuests = [],
+        /** @var array<AdditionalGuest> $additionalGuests */ public array $additionalGuests = [],
     ) {}

     public function totalBillableGuests(): int

      ----------- end diff -----------

I have no value for method_argument_space and I failed to have back the old behavior. Anyone can help ?

ostrolucky commented 7 months ago

Workaround I found is to use @param above method instead

      ---------- begin diff ----------
--- /var/task/src/Operation/Reception/Domain/ReadModel/GuestInformation.php
+++ /var/task/src/Operation/Reception/Domain/ReadModel/GuestInformation.php
@@ -9,8 +9,7 @@
+      /** @param array<AdditionalGuest> $additionalGuests */ 
         public function __construct(
         public int $nbChildren,
         public int $nbBabies,
-        /** @var array<AdditionalGuest> $additionalGuests */ 
        public array $additionalGuests = [],
     ) {}

then fixer will not touch it

tyx commented 7 months ago

thanks for your help, I will give a try !