1 | <?php |
||
20 | class User implements UserInterface |
||
21 | { |
||
22 | |||
23 | use FormattedRegistrationDateTrait; |
||
24 | |||
25 | const TOKEN_LENGTH = 32; |
||
26 | |||
27 | /** |
||
28 | * @var string |
||
29 | * @ORM\Id |
||
30 | * @ORM\Column(name="login", type="string", length=255, nullable=false) |
||
31 | */ |
||
32 | private $login; |
||
33 | |||
34 | /** |
||
35 | * @var string |
||
36 | * @ORM\Column(name="name", type="string", length=255, nullable=false, unique=true) |
||
37 | */ |
||
38 | private $name; |
||
39 | |||
40 | /** |
||
41 | * @var string |
||
42 | * @ORM\Column(name="email", type="string", length=255, nullable=true, unique=true) |
||
43 | * @Serializer\Exclude() |
||
44 | */ |
||
45 | private $email; |
||
46 | |||
47 | /** |
||
48 | * @var string |
||
49 | * @ORM\Column(name="description", type="text", nullable=true) |
||
50 | */ |
||
51 | private $description; |
||
52 | |||
53 | /** |
||
54 | * @var string |
||
55 | * @ORM\Column(name="vkontakte_id", type="string", length=50, nullable=false, unique=true) |
||
56 | * @Serializer\Exclude() |
||
57 | */ |
||
58 | private $vkontakteId; |
||
59 | |||
60 | /** |
||
61 | * @var string |
||
62 | * @ORM\Column(name="vk_token", type="string", length=85, nullable=false) |
||
63 | * @Serializer\Exclude() |
||
64 | */ |
||
65 | private $vkToken; |
||
66 | |||
67 | /** |
||
68 | * @var string |
||
69 | * @ORM\Column(name="token", type="string", length=32, nullable=false, unique=true) |
||
70 | * @Serializer\Exclude() |
||
71 | */ |
||
72 | private $token; |
||
73 | |||
74 | /** |
||
75 | * @var \DateTime |
||
76 | * @ORM\Column(name="registration_date", type="datetime", nullable=false) |
||
77 | * @SerializedName("registration_date") |
||
78 | * @Accessor(getter="getRegistrationDate") |
||
79 | * @SerializerType("string") |
||
80 | */ |
||
81 | private $registrationDate; |
||
82 | |||
83 | /** |
||
84 | * @var array |
||
85 | * @ORM\Column(name="roles", type="simple_array", nullable=true) |
||
86 | * @Serializer\Exclude() |
||
87 | */ |
||
88 | private $roles; |
||
89 | |||
90 | /** |
||
91 | * @var Event[]|ArrayCollection |
||
92 | * @ORM\OneToMany(targetEntity="AppBundle\Entity\Event", mappedBy="creator") |
||
93 | * @SerializerType("array") |
||
94 | */ |
||
95 | private $events; |
||
96 | |||
97 | /** |
||
98 | * @var Band[]|ArrayCollection |
||
99 | * @ORM\OneToMany(targetEntity="AppBundle\Entity\Band", mappedBy="creator") |
||
100 | * @SerializerType("array") |
||
101 | */ |
||
102 | private $createdBands; |
||
103 | |||
104 | 4 | public function __construct( |
|
124 | |||
125 | /** |
||
126 | * @return string |
||
127 | */ |
||
128 | 25 | public function getLogin(): string |
|
129 | { |
||
130 | 25 | return $this->login; |
|
131 | } |
||
132 | |||
133 | /** {@inheritDoc} */ |
||
134 | 24 | public function getRoles(): array |
|
143 | |||
144 | public function setVkToken(string $vkToken) |
||
148 | |||
149 | public function updateToken() |
||
153 | |||
154 | 1 | public function getToken(): string |
|
155 | { |
||
156 | 1 | return $this->token; |
|
157 | } |
||
158 | |||
159 | /** {@inheritDoc} */ |
||
160 | public function getPassword() {} |
||
161 | |||
162 | /** {@inheritDoc} */ |
||
163 | public function getSalt() {} |
||
164 | |||
165 | /** {@inheritDoc} */ |
||
166 | public function eraseCredentials() {} |
||
167 | |||
168 | /** {@inheritDoc} */ |
||
169 | 25 | public function getUsername(): string |
|
173 | |||
174 | 1 | public function getName(): string |
|
178 | } |
||
179 |
This check looks for assignments to scalar types that may be of the wrong type.
To ensure the code behaves as expected, it may be a good idea to add an explicit type cast.