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;
20
20
final class UserResetPasswordDto
21
21
{
22
22
#[Assert\Email]
23
- public $email;
23
+ public string $email;
24
24
}
25
25
```
26
26
Original file line number Diff line number Diff line change @@ -103,11 +103,8 @@ use Symfony\Component\Mailer\MailerInterface;
103
103
104
104
final class BookMailSubscriber implements EventSubscriberInterface
105
105
{
106
- private $mailer;
107
-
108
- public function __construct(MailerInterface $mailer)
106
+ public function __construct(private MailerInterface $mailer)
109
107
{
110
- $this->mailer = $mailer;
111
108
}
112
109
113
110
public static function getSubscribedEvents()
Original file line number Diff line number Diff line change @@ -24,11 +24,8 @@ use App\Uuid;
24
24
#[ApiResource(provider: PersonProvider::class)]
25
25
final class Person
26
26
{
27
- /**
28
- * @var Uuid
29
- */
30
27
#[ApiProperty(identifier: true)]
31
- public $code;
28
+ public Uuid $code;
32
29
33
30
// ...
34
31
}
@@ -214,12 +211,9 @@ final class Person
214
211
#[ApiProperty(identifier: false)]
215
212
private ?int $id = null;
216
213
217
- /**
218
- * @var Uuid
219
- */
220
214
#[ORM\Column(type: 'uuid', unique: true)]
221
215
#[ApiProperty(identifier: true)]
222
- public $code;
216
+ public Uuid $code;
223
217
224
218
// ...
225
219
}
Original file line number Diff line number Diff line change @@ -548,13 +548,10 @@ use Symfony\Component\Serializer\Annotation\Groups;
548
548
class Person
549
549
{
550
550
#[Groups('person')]
551
- public $name;
551
+ public string $name;
552
552
553
- /**
554
- * @var Person
555
- */
556
553
#[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.
558
555
559
556
// ...
560
557
}
@@ -607,7 +604,7 @@ class Person
607
604
608
605
#[Groups('person')]
609
606
#[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.
611
608
612
609
// ...
613
610
}
@@ -808,9 +805,8 @@ class Greeting
808
805
#[Groups("greeting:collection:get")]
809
806
private ?int $id = null;
810
807
811
- private $a = 1;
812
-
813
- private $b = 2;
808
+ private int $a = 1;
809
+ private int $b = 2;
814
810
815
811
#[ORM\C olumn]
816
812
#[Groups("greeting:collection:get")]
@@ -1182,7 +1178,7 @@ class Book
1182
1178
// ...
1183
1179
1184
1180
#[ApiProperty(identifier: true)]
1185
- private $id;
1181
+ private ?int $id;
1186
1182
1187
1183
/**
1188
1184
* This field can be managed only by an admin
You can’t perform that action at this time.
0 commit comments