Skip to content

Commit 87cdcf8

Browse files
committed
minor #18236 [Security] Use attributes for entity example (MrYamous)
This PR was merged into the 5.4 branch. Discussion ---------- [Security] Use attributes for entity example Use attributes in place of annotations for consistency as we are using it for entity examples in some other pages or for routing further on security doc Commits ------- 2e0598b use attributes for entity example
2 parents ac6b7f7 + 2e0598b commit 87cdcf8

File tree

1 file changed

+7
-18
lines changed

1 file changed

+7
-18
lines changed

security.rst

+7-18
Original file line numberDiff line numberDiff line change
@@ -125,32 +125,21 @@ from the `MakerBundle`_:
125125
use Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface;
126126
use Symfony\Component\Security\Core\User\UserInterface;
127127
128-
/**
129-
* @ORM\Entity(repositoryClass=UserRepository::class)
130-
*/
128+
#[ORM\Entity(repositoryClass: UserRepository::class)]
131129
class User implements UserInterface, PasswordAuthenticatedUserInterface
132130
{
133-
/**
134-
* @ORM\Id
135-
* @ORM\GeneratedValue
136-
* @ORM\Column(type="integer")
137-
*/
131+
#[ORM\Id]
132+
#[ORM\GeneratedValue]
133+
#[ORM\Column(type: 'integer')]
138134
private $id;
139135
140-
/**
141-
* @ORM\Column(type="string", length=180, unique=true)
142-
*/
136+
#[ORM\Column(type: 'string', length: 180, unique: true)]
143137
private $email;
144138
145-
/**
146-
* @ORM\Column(type="json")
147-
*/
139+
#[ORM\Column(type: 'json')]
148140
private $roles = [];
149141
150-
/**
151-
* @var string The hashed password
152-
* @ORM\Column(type="string")
153-
*/
142+
#[ORM\Column(type: 'string')]
154143
private $password;
155144
156145
public function getId(): ?int

0 commit comments

Comments
 (0)