File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ final class User implements
3737
3838 private $ name ;
3939 private $ password = '' ;
40- private $ roles ;
40+ private $ roles = [] ;
4141 private $ salt = '' ;
4242
4343 private $ createdAt ;
@@ -58,7 +58,6 @@ public function __construct(string $name)
5858 $ this ->accountNonExpired = true ;
5959 $ this ->credentialsNonExpired = true ;
6060 $ this ->accountNonLocked = true ;
61- $ this ->roles = array ();
6261 $ this ->salt = 'KJH6212kjwek_fj23D01-239.1023fkjdsj^k2hdfssfjk!h234uiy4324 ' ;
6362 }
6463
@@ -105,7 +104,7 @@ public function setLastSeenAt($lastSeenAt)
105104 /**
106105 * {@inheritdoc}
107106 */
108- public function getRoles ()
107+ public function getRoles (): array
109108 {
110109 return $ this ->roles ;
111110 }
@@ -135,7 +134,7 @@ public function getSalt(): ?string
135134 /**
136135 * {@inheritdoc}
137136 */
138- public function getUsername ()
137+ public function getUsername (): string
139138 {
140139 return $ this ->getName ();
141140 }
Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ public function setRoleProvider(RoleProviderInterface $roleProvider)
3232 $ this ->roleProvider = $ roleProvider ;
3333 }
3434
35- public function loadUserByUsername ($ username )
35+ public function loadUserByUsername ($ username ): UserInterface
3636 {
3737 return $ this ->loadUserByIdentifier ((string ) $ username );
3838 }
@@ -64,7 +64,7 @@ public function loadUserByIdentifier(string $identifier): UserInterface
6464 return $ user ;
6565 }
6666
67- public function refreshUser (UserInterface $ user )
67+ public function refreshUser (UserInterface $ user ): UserInterface
6868 {
6969 if (!$ user instanceof User) {
7070 throw new UnsupportedUserException (sprintf ('Instances of "%s" are not supported. ' , get_class ($ user )));
@@ -77,7 +77,7 @@ public function refreshUser(UserInterface $user)
7777 return $ this ->loadUserByIdentifier ($ user ->getUserIdentifier ());
7878 }
7979
80- public function supportsClass ($ class )
80+ public function supportsClass ($ class ): bool
8181 {
8282 return User::class === $ class ;
8383 }
You can’t perform that action at this time.
0 commit comments