| 1 | <?php |
||
| 10 | class ForceLogin implements AdapterInterface |
||
| 11 | { |
||
| 12 | /** |
||
| 13 | * @var UserInterface|int |
||
| 14 | */ |
||
| 15 | protected $user; |
||
| 16 | |||
| 17 | /** |
||
| 18 | * @param UserInterface|int $user |
||
| 19 | */ |
||
| 20 | 1 | public function __construct($user) |
|
| 24 | |||
| 25 | public function authenticate() |
||
| 26 | { |
||
| 27 | return new Result( |
||
| 28 | Result::SUCCESS, |
||
| 29 | is_int($this->getUser()) ? $this->getUser() : $this->getUser()->getId() |
||
| 30 | ); |
||
| 31 | } |
||
| 32 | |||
| 33 | /** |
||
| 34 | * @return UserInterface|int |
||
| 35 | */ |
||
| 36 | public function getUser() |
||
| 40 | |||
| 41 | /** |
||
| 42 | * @param UserInterface|int $user |
||
| 43 | * @return $this |
||
| 44 | */ |
||
| 45 | public function setUser($user) |
||
| 50 | } |
||
| 51 |