1 | <?php |
||
18 | class AddHostPlugin implements Plugin |
||
19 | { |
||
20 | /** |
||
21 | * @var UriInterface |
||
22 | */ |
||
23 | private $host; |
||
24 | |||
25 | /** |
||
26 | * @var bool |
||
27 | */ |
||
28 | private $replace; |
||
29 | |||
30 | /** |
||
31 | * @param UriInterface $host |
||
32 | * @param array $config { |
||
33 | * |
||
34 | * @var bool $replace True will replace all hosts, false will only add host when none is specified. |
||
35 | * } |
||
36 | */ |
||
37 | 5 | public function __construct(UriInterface $host, array $config = []) |
|
51 | |||
52 | /** |
||
53 | * {@inheritdoc} |
||
54 | */ |
||
55 | 3 | public function handleRequest(RequestInterface $request, callable $next, callable $first) |
|
66 | |||
67 | /** |
||
68 | * @param OptionsResolver $resolver |
||
69 | */ |
||
70 | 5 | private function configureOptions(OptionsResolver $resolver) |
|
77 | } |
||
78 |
If you suppress an error, we recommend checking for the error condition explicitly: