blob: 520d4ad6450d84426907282436d8be84bebaad13 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
<?php
/** Class UserToken
*
* @package DevCoder\Authentication
*
*/
// namespace DevCoder\Authentication\Token;
// use DevCoder\Authentication\UserInterface;
class UserToken implements UserTokenInterface
{
/**
* @var UserInterface
*/
private $user;
public function __construct(UserInterface $user)
{
$this->user = $user;
}
/** getUser
*
*/
public function getUser(): UserInterface
{
return $this->user;
}
/** serialize()
*
* serializes the user structure (with user's property values)
* ... then it will be saved into session[DEFAULT_PREFIX_KEY]
*
*/
public function serialize(): string
{
return serialize($this);
}
}
|