File tree 1 file changed +6
-3
lines changed
1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change 14
14
class Crawler extends \Embed \Http \Crawler implements ClientInterface, RequestFactoryInterface, UriFactoryInterface
15
15
{
16
16
protected RequestFactoryInterface $ requestFactory ;
17
+
17
18
protected UriFactoryInterface $ uriFactory ;
19
+
18
20
protected ClientInterface $ client ;
21
+
19
22
protected array $ defaultHeaders = [
20
23
'User-Agent ' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:73.0) Gecko/20100101 Firefox/73.0 ' ,
21
24
'Cache-Control ' => 'max-age=0 ' ,
22
25
];
23
26
24
27
public function __construct (?ClientInterface $ client = null , ?RequestFactoryInterface $ requestFactory = null , ?UriFactoryInterface $ uriFactory = null )
25
28
{
26
- $ this ->client = $ client ?: new CurlClient () ;
29
+ $ this ->client = $ client ?: new CurlClient ;
27
30
$ this ->requestFactory = $ requestFactory ?: FactoryDiscovery::getRequestFactory ();
28
31
$ this ->uriFactory = $ uriFactory ?: FactoryDiscovery::getUriFactory ();
29
32
}
@@ -34,7 +37,7 @@ public function addDefaultHeaders(array $headers): void
34
37
}
35
38
36
39
/**
37
- * @param UriInterface|string $uri The URI associated with the request.
40
+ * @param UriInterface|string $uri The URI associated with the request.
38
41
*/
39
42
public function createRequest (string $ method , $ uri ): RequestInterface
40
43
{
@@ -79,4 +82,4 @@ public function getResponseUri(ResponseInterface $response): ?UriInterface
79
82
80
83
return $ location ? $ this ->uriFactory ->createUri ($ location ) : null ;
81
84
}
82
- }
85
+ }
You can’t perform that action at this time.
0 commit comments