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

Found 10 rules:

RemoveUselessVarTagRector

Remove unused @var annotation for properties and class constants

 final class SomeClass
 {
-    /**
-     * @var string
-     */
     public string $name = 'name';
 }
SETS:  Dead Code

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

RemoveUselessReturnTagRector

Remove @return docblock with same type as defined in PHP

 use stdClass;

 class SomeClass
 {
-    /**
-     * @return stdClass
-     */
     public function foo(): stdClass
     {
     }
 }
SETS:  Dead Code

RemoveUselessParamTagRector

Remove @param docblock with same type as parameter type

 class SomeClass
 {
     /**
-     * @param string $a
      * @param string $b description
      */
     public function foo(string $a, string $b)
     {
     }
 }
SETS:  Dead Code

RemoveNullTagValueNodeRector

Remove @var/@param/@return null docblock

 class SomeClass
 {
-    /**
-     * @return null
-     */
     public function foo()
     {
         return null;
     }
 }
SETS:  Dead Code

InlineVarDocTagToAssertRector

Convert inline @var tags to calls to assert()

-/** @var Foo $foo */
-$foo = createFoo();
+$foo = createFoo();
+assert($foo instanceof Foo);

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;
     }
 }

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

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);
     }
 }