Conditions | 2 |
Paths | 2 |
Total Lines | 22 |
Code Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
29 | public static function create($url, $token) |
||
30 | { |
||
31 | $plugins = [ |
||
32 | new RedirectPlugin(), |
||
|
|||
33 | new RetryPlugin(['retries' => 5]), |
||
34 | new DecoderPlugin(), |
||
35 | new ErrorPlugin(), |
||
36 | ]; |
||
37 | |||
38 | if ($token) { |
||
39 | $plugins[] = new AuthenticationPlugin(new QueryParam([ |
||
40 | 'api_key' => $token, |
||
41 | ])); |
||
42 | } |
||
43 | |||
44 | $client = new HttpMethodsClient( |
||
45 | new PluginClient(HttpClientDiscovery::find(), $plugins), |
||
46 | MessageFactoryDiscovery::find() |
||
47 | ); |
||
48 | |||
49 | return new HttpPlugHttpAdapterClient($client, $url); |
||
50 | } |
||
51 | } |
||
52 |
This class, trait or interface has been deprecated. The supplier of the file has supplied an explanatory message.
The explanatory message should give you some clue as to whether and when the type will be removed from the class and what other constant to use instead.