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

Found 10 rules:

RemoveReadonlyPropertyVisibilityOnReadonlyClassRector

Remove readonly property visibility on readonly class

 final readonly class SomeClass
 {
     public function __construct(
-        private readonly string $name
+        private string $name
     ) {
     }
 }
SETS:  Code Quality

RemoveUselessReadOnlyTagRector

Remove useless @readonly annotation on native readonly type

 final class SomeClass
 {
-    /**
-     * @readonly
-     */
     private readonly string $name;

     public function __construct(string $name)
     {
         $this->name = $name;
     }
 }
SETS:  Dead Code

Configurable

RemoveDumpDataDeadCodeRector

It will removes the dump data just like dd or dump functions from the code.`

 class MyController
 {
     public function store()
     {
-        dd('test');
         return true;
     }

     public function update()
     {
-        dump('test');
         return true;
     }
 }

RemoveReflectionSetAccessibleCallsRector

Remove Reflection::setAccessible() calls

 $reflectionProperty = new ReflectionProperty($object, 'property');
-$reflectionProperty->setAccessible(true);
 $value = $reflectionProperty->getValue($object);

 $reflectionMethod = new ReflectionMethod($object, 'method');
-$reflectionMethod->setAccessible(false);
 $reflectionMethod->invoke($object);
SETS:  PHP 8.1

RemoveGetClassGetParentClassNoArgsRector

Replace calls to get_class() and get_parent_class() without arguments with self::class and parent::class

 class Example extends StdClass {
     public function whoAreYou() {
-        return get_class() . ' daughter of ' . get_parent_class();
+        return self::class . ' daughter of ' . parent::class;
     }
 }
SETS:  PHP 8.3

RemoveFinfoBufferContextArgRector

Remove argument by position by function name

-finfo_buffer($finfo, $fileContents, FILEINFO_NONE, []);
+finfo_buffer($finfo, $fileContents, FILEINFO_NONE);
SETS:  PHP 8.5

RemoveExtraParametersRector

Remove extra parameters

-strlen("asdf", 1);
+strlen("asdf");

Configurable

RemoveMethodCallParamRector

Remove parameter of method call

 final class SomeClass
 {
     public function run(Caller $caller)
     {
-        $caller->process(1, 2);
+        $caller->process(1);
     }
 }

RemoveUselessAliasInUseStatementRector

Remove useless alias in use statement as same name with last use statement name

-use App\Bar as Bar;
+use App\Bar;
SETS:  Coding Style

RemoveFinalFromConstRector

Remove final from constants in classes defined as final

 final class SomeClass
 {
-    final public const NAME = 'value';
+    public const NAME = 'value';
 }
SETS:  Coding Style