1 | <?php |
||
13 | final class Matching implements Authentication |
||
14 | { |
||
15 | /** |
||
16 | * @var Authentication |
||
17 | */ |
||
18 | private $authentication; |
||
19 | |||
20 | /** |
||
21 | * @var callable |
||
22 | */ |
||
23 | private $matcher; |
||
24 | |||
25 | /** |
||
26 | * @param Authentication $authentication |
||
27 | * @param callable|null $matcher |
||
28 | */ |
||
29 | 9 | public function __construct(Authentication $authentication, callable $matcher = null) |
|
40 | |||
41 | /** |
||
42 | * Returns the authentication. |
||
43 | * |
||
44 | * @return string |
||
45 | */ |
||
46 | 2 | public function getAuthentication() |
|
50 | |||
51 | /** |
||
52 | * Sets the authentication. |
||
53 | * |
||
54 | * @param Authentication $authentication |
||
55 | */ |
||
56 | 1 | public function setAuthentication(Authentication $authentication) |
|
60 | |||
61 | /** |
||
62 | * Returns the matcher. |
||
63 | * |
||
64 | * @return callable |
||
65 | */ |
||
66 | 2 | public function getMatcher() |
|
70 | |||
71 | /** |
||
72 | * Sets the matcher. |
||
73 | * |
||
74 | * @param callable $matcher |
||
75 | */ |
||
76 | 2 | public function setMatcher(callable $matcher) |
|
80 | |||
81 | /** |
||
82 | * {@inheritdoc} |
||
83 | */ |
||
84 | 2 | public function authenticate(RequestInterface $request) |
|
92 | |||
93 | /** |
||
94 | * Creates a matching authentication for an URL. |
||
95 | * |
||
96 | * @param Authentication $authentication |
||
97 | * @param string $url |
||
98 | * |
||
99 | * @return self |
||
100 | */ |
||
101 | public static function createUrlMatcher(Authentication $authentication, $url) |
||
109 | } |
||
110 |