File tree Expand file tree Collapse file tree 4 files changed +10
-23
lines changed
Expand file tree Collapse file tree 4 files changed +10
-23
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ use Symfony\Component\Validator\Constraints as Assert;
2020final class UserResetPasswordDto
2121{
2222 #[Assert\Email]
23- public $email;
23+ public string $email;
2424}
2525```
2626
Original file line number Diff line number Diff line change @@ -103,11 +103,8 @@ use Symfony\Component\Mailer\MailerInterface;
103103
104104final class BookMailSubscriber implements EventSubscriberInterface
105105{
106- private $mailer;
107-
108- public function __construct(MailerInterface $mailer)
106+ public function __construct(private MailerInterface $mailer)
109107 {
110- $this->mailer = $mailer;
111108 }
112109
113110 public static function getSubscribedEvents()
Original file line number Diff line number Diff line change @@ -24,11 +24,8 @@ use App\Uuid;
2424#[ApiResource(provider: PersonProvider::class)]
2525final class Person
2626{
27- /**
28- * @var Uuid
29- */
3027 #[ApiProperty(identifier: true)]
31- public $code;
28+ public Uuid $code;
3229
3330 // ...
3431}
@@ -214,12 +211,9 @@ final class Person
214211 #[ApiProperty(identifier: false)]
215212 private ?int $id = null;
216213
217- /**
218- * @var Uuid
219- */
220214 #[ORM\Column(type: 'uuid', unique: true)]
221215 #[ApiProperty(identifier: true)]
222- public $code;
216+ public Uuid $code;
223217
224218 // ...
225219}
Original file line number Diff line number Diff line change @@ -548,13 +548,10 @@ use Symfony\Component\Serializer\Annotation\Groups;
548548class Person
549549{
550550 #[Groups('person')]
551- public $name;
551+ public string $name;
552552
553- /**
554- * @var Person
555- */
556553 #[Groups('person')]
557- public $parent; // Note that a Person instance has a relation with another Person.
554+ public ?Person $parent; // Note that a Person instance has a relation with another Person.
558555
559556 // ...
560557}
@@ -607,7 +604,7 @@ class Person
607604
608605 #[Groups('person')]
609606 #[ApiProperty(readableLink: false, writableLink: false)]
610- public Person $parent; // This property is now serialized/deserialized as an IRI.
607+ public ? Person $parent; // This property is now serialized/deserialized as an IRI.
611608
612609 // ...
613610}
@@ -808,9 +805,8 @@ class Greeting
808805 #[Groups("greeting:collection:get")]
809806 private ?int $id = null;
810807
811- private $a = 1;
812-
813- private $b = 2;
808+ private int $a = 1;
809+ private int $b = 2;
814810
815811 #[ORM\C olumn]
816812 #[Groups("greeting:collection:get")]
@@ -1182,7 +1178,7 @@ class Book
11821178 // ...
11831179
11841180 #[ApiProperty(identifier: true)]
1185- private $id;
1181+ private ?int $id;
11861182
11871183 /**
11881184 * This field can be managed only by an admin
You can’t perform that action at this time.
0 commit comments