Skip to content

Commit 2e0598b

Browse files
committed
use attributes for entity example
1 parent 57ce0f4 commit 2e0598b

File tree

1 file changed

+7
-18
lines changed

1 file changed

+7
-18
lines changed

security.rst

Lines changed: 7 additions & 18 deletions
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)