Find the best Rector rule to solve your problem. Searching through 1009 rules.
Found 4 rules:
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');
+ }
}
Add type to property by added rules, mostly public/property by parent type
class SomeClass extends ParentClass
{
- public $name;
+ public string $name;
}
Enable "framework.validation.enable_attributes" config, to load validation rules from attributes
$container->loadFromExtension('framework', [
'validation' => [
- 'enable_attributes' => false,
+ 'enable_attributes' => true,
],
]);
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'],
]);