Run Rector on your code to see what it can do for you:

 <?php
 
 final class DemoFile
 {
-    public mixed $value {
-    	get {
+    public function __construct(public mixed $value {
+        get {
         	return $this->value;
-        }
+        }
         set {
             if ($this->optionUsedInValueSetter) {
             	$this->value = "changed value";
             }
             $this->value = $value;
-        }
-    }
-    
-    public function __construct(
-    	mixed $value,
-        bool $optionUsedInValueSetter = false,
-    ) {
-    	$this->value = $value;
+        }
+    }, bool $optionUsedInValueSetter = false)
+    {
     }
 }
PHP snippet to change

Applied Rules:

Not a change you expect?

Config  rector.php
Rector version: b09565 - released at 2026-05-25 06:37