Find a Rector rule

Find the best Rector rule to solve your problem. Searching through 1108 rules.

Found 2 rules, grouped by set: Clear

PHP 8.6 2 matches

Convert nested min()/max() calls to clamp()

-$result = max(0, min(100, $value));
+$result = clamp($value, 0, 100);

Move a constant constructor assignment of a readonly property to a property default value

 final class SomeClass
 {
-    public readonly int $number;
+    public readonly int $number = 100;

     public function __construct()
     {
-        $this->number = 100;
     }
 }