1 | <?php |
||
13 | final class Chain implements Authentication |
||
14 | { |
||
15 | /** |
||
16 | * @var Authentication[] |
||
17 | */ |
||
18 | private $authenticationChain = []; |
||
19 | |||
20 | /** |
||
21 | * @param Authentication[] $authenticationChain |
||
22 | */ |
||
23 | 7 | public function __construct(array $authenticationChain = []) |
|
27 | |||
28 | /** |
||
29 | * Adds an Authentication method to the chain. |
||
30 | * |
||
31 | * The order of authentication methods SHOULD NOT matter. |
||
32 | * |
||
33 | * @param Authentication $authentication |
||
34 | */ |
||
35 | 5 | public function addAuthentication(Authentication $authentication) |
|
39 | |||
40 | /** |
||
41 | * Returns the current authentication chain. |
||
42 | * |
||
43 | * @return Authentication[] |
||
44 | */ |
||
45 | 4 | public function getAuthenticationChain() |
|
49 | |||
50 | /** |
||
51 | * Replaces the current authentication chain. |
||
52 | * |
||
53 | * @param array $authenticationChain |
||
54 | */ |
||
55 | 7 | public function setAuthenticationChain(array $authenticationChain) |
|
63 | |||
64 | /** |
||
65 | * Clears the authentication chain. |
||
66 | */ |
||
67 | 7 | public function clearAuthenticationChain() |
|
71 | |||
72 | /** |
||
73 | * {@inheritdoc} |
||
74 | */ |
||
75 | 1 | public function authenticate(RequestInterface $request) |
|
83 | } |
||
84 |