1 | <?php |
||
15 | class CommonProxy implements GoogleProxyInterface |
||
16 | { |
||
17 | /** @var string $endpoint */ |
||
18 | protected $endpoint; |
||
19 | |||
20 | /** |
||
21 | * Constructor that initializes the specific proxy service |
||
22 | * |
||
23 | * @param string $endpoint Specific service URL |
||
24 | * @throws InvalidUrlException |
||
25 | */ |
||
26 | 6 | public function __construct(string $endpoint) |
|
27 | { |
||
28 | 6 | if (!filter_var($endpoint, FILTER_VALIDATE_URL)) { |
|
29 | 1 | throw new InvalidUrlException("Invalid CommonProxy endpoint: $endpoint"); |
|
30 | } |
||
31 | |||
32 | 5 | $this->endpoint = $endpoint; |
|
33 | 5 | } |
|
34 | |||
35 | /** {@inheritdoc} */ |
||
36 | 3 | public function getHttpResponse(string $url): ResponseInterface |
|
44 | |||
45 | /** {@inheritdoc} */ |
||
46 | 5 | public function parseUrl(string $url): string |
|
62 | } |
||
63 |