Find the best Rector rule to solve your problem


DowngradeSymfonyCommandAttributeRector

Downgrade Symfony Command Attribute

 #[AsCommand(name: 'app:create-user', description: 'some description')]
 class CreateUserCommand extends Command
 {
+    protected function configure(): void
+    {
+        $this->setName('app:create-user');
+        $this->setDescription('some description');
+    }
 }

Configurable

AddPropertyTypeDeclarationRector

Add type to property by added rules, mostly public/property by parent type

 class SomeClass extends ParentClass
 {
-    public $name;
+    public string $name;
 }

ValidationRuleArrayStringValueToArrayRector

Convert string validation rules into arrays for Laravel's Validator.

 Validator::make($data, [
-    'field' => 'required|nullable|string|max:255',
+    'field' => ['required', 'nullable', 'string', 'max:255'],
 ]);