Run Rector on your code to see what it can do for you:
<?php use Symfony\Component\Validator\Constraints as Assert;
class Model { - /** - * @Assert\Type("string") - */ + #[Assert\Type('string')] protected string $str; - /** - * @Assert\All({ - * @Assert\Type("string") - * }) - */ + #[Assert\All([new Assert\Type('string')])] protected array $items; }
Applied Rules:
Not a change you expect?
rector.php