Add typed property from JMS Serializer Type attribute
final class SomeClass
{
#[\JMS\Serializer\Annotation\Type('string')]
- private $name;
+ private ?string $name = null;
}
Configure your rector.php
:
<?php
use Rector\Config\RectorConfig;
use Rector\TypeDeclaration\Rector\Class_\TypedPropertyFromJMSSerializerAttributeTypeRector;
return RectorConfig::configure()
->withRules([
TypedPropertyFromJMSSerializerAttributeTypeRector::class,
]);