1 | <?php |
||
9 | class BaseUriPlugin implements Plugin |
||
10 | { |
||
11 | /** |
||
12 | * @var string |
||
13 | */ |
||
14 | private $baseUri; |
||
15 | |||
16 | /** |
||
17 | * @var UriFactory |
||
18 | */ |
||
19 | private $factory; |
||
20 | |||
21 | /** |
||
22 | * @param UriFactory $factory |
||
23 | * @param string $baseUri |
||
24 | */ |
||
25 | public function __construct(UriFactory $factory, $baseUri) |
||
30 | |||
31 | /** |
||
32 | * Handle the request and return the response coming from the next callable. |
||
33 | * |
||
34 | * @param RequestInterface $request |
||
35 | * @param callable $next Next middleware in the chain, the request is passed as the first argument |
||
36 | * @param callable $first First middleware in the chain, used to to restart a request |
||
37 | * |
||
38 | * @return Promise |
||
39 | */ |
||
40 | public function handleRequest(RequestInterface $request, callable $next, callable $first) |
||
59 | } |
||
60 |