Skip to content

Commit fbc76bb

Browse files
committed
Tweak the entity constructor
1 parent c512f19 commit fbc76bb

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/Entity/Tag.php

+6-4
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,12 @@ class Tag implements \JsonSerializable
2929
#[ORM\Column(type: 'integer')]
3030
private ?int $id = null;
3131

32-
public function __construct(
33-
#[ORM\Column(type: 'string', unique: true)]
34-
private readonly string $name,
35-
) {
32+
#[ORM\Column(type: 'string', unique: true)]
33+
private readonly string $name;
34+
35+
public function __construct(string $name)
36+
{
37+
$this->name = $name;
3638
}
3739

3840
public function getId(): ?int

0 commit comments

Comments
 (0)