1 | <?php |
||
2 | namespace VDB\Spider\RequestHandler; |
||
3 | |||
4 | use GuzzleHttp\Client; |
||
5 | use GuzzleHttp\HandlerStack; |
||
6 | use GuzzleHttp\Message\Request; |
||
0 ignored issues
–
show
|
|||
7 | use GuzzleHttp\Message\RequestInterface; |
||
0 ignored issues
–
show
The type
GuzzleHttp\Message\RequestInterface was not found. Maybe you did not declare it correctly or list all dependencies?
The issue could also be caused by a filter entry in the build configuration.
If the path has been excluded in your configuration, e.g. filter:
dependency_paths: ["lib/*"]
For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths
Loading history...
|
|||
8 | use VDB\Spider\RequestHandler\RequestHandlerInterface; |
||
9 | use VDB\Spider\Resource; |
||
10 | use VDB\Spider\Uri\DiscoveredUri; |
||
11 | |||
12 | /** |
||
13 | * @author Matthijs van den Bos <[email protected]> |
||
14 | * @copyright 2013 Matthijs van den Bos |
||
15 | */ |
||
16 | class GuzzleRequestHandler implements RequestHandlerInterface |
||
17 | { |
||
18 | /** @var Client */ |
||
19 | private $client; |
||
20 | |||
21 | /** |
||
22 | * @param Client $client |
||
23 | * @return RequestHandlerInterface |
||
24 | */ |
||
25 | public function setClient(Client $client) |
||
26 | { |
||
27 | $this->client = $client; |
||
28 | |||
29 | return $this; |
||
30 | } |
||
31 | |||
32 | /** |
||
33 | * @return Client |
||
34 | */ |
||
35 | public function getClient() |
||
36 | { |
||
37 | if (!$this->client) { |
||
38 | $this->client = new Client(); |
||
39 | } |
||
40 | |||
41 | return $this->client; |
||
42 | } |
||
43 | |||
44 | /** |
||
45 | * @param DiscoveredUri $uri |
||
46 | * @return Resource |
||
47 | */ |
||
48 | public function request(DiscoveredUri $uri) |
||
49 | { |
||
50 | $response = $this->getClient()->get($uri->toString()); |
||
51 | return new Resource($uri, $response); |
||
52 | } |
||
53 | } |
||
54 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths