| Total Complexity | 5 |
| Total Lines | 29 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 3 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 18 | class Endpoint extends Source |
||
| 19 | { |
||
| 20 | use DetectsEndpoints; |
||
| 21 | |||
| 22 | /** |
||
| 23 | * Determine whether this class can handle the source. |
||
| 24 | */ |
||
| 25 | 47 | public function matches(): bool |
|
| 26 | { |
||
| 27 | 47 | return (is_string($this->source) && $this->isEndpoint($this->source)) |
|
| 28 | 47 | || $this->source instanceof UriInterface; |
|
| 29 | } |
||
| 30 | |||
| 31 | /** |
||
| 32 | * Retrieve the HTTP request. |
||
| 33 | */ |
||
| 34 | 40 | public function request(): RequestInterface |
|
| 35 | { |
||
| 36 | 40 | return new Request('GET', $this->source); |
|
| 37 | } |
||
| 38 | |||
| 39 | /** |
||
| 40 | * Retrieve the HTTP response. |
||
| 41 | * |
||
| 42 | * @return ResponseInterface |
||
| 43 | */ |
||
| 44 | 40 | public function response(): ResponseInterface |
|
| 47 | } |
||
| 48 | } |
||
| 49 |