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 | 7 | public function __construct(Authentication $authentication, callable $matcher = null) |
|
40 | |||
41 | /** |
||
42 | * Returns the authentication. |
||
43 | * |
||
44 | * @return string |
||
45 | */ |
||
46 | 1 | public function getAuthentication() |
|
50 | |||
51 | /** |
||
52 | * Returns the matcher. |
||
53 | * |
||
54 | * @return callable |
||
55 | */ |
||
56 | 1 | public function getMatcher() |
|
60 | |||
61 | /** |
||
62 | * {@inheritdoc} |
||
63 | */ |
||
64 | 2 | public function authenticate(RequestInterface $request) |
|
72 | |||
73 | /** |
||
74 | * Creates a matching authentication for an URL. |
||
75 | * |
||
76 | * @param Authentication $authentication |
||
77 | * @param string $url |
||
78 | * |
||
79 | * @return self |
||
80 | */ |
||
81 | public static function createUrlMatcher(Authentication $authentication, $url) |
||
89 | } |
||
90 |