| Conditions | 2 |
| Paths | 2 |
| Total Lines | 16 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 12 | 1 | public function addClient( |
|
| 13 | string $name, |
||
| 14 | string $baseUri, |
||
| 15 | ClientRegistryInterface $clientRegistry, |
||
| 16 | array $defaults = [], |
||
| 17 | array $middlewares = [] |
||
| 18 | ) { |
||
| 19 | 1 | $handlerStack = new HandlerStack(new CurlHandler()); |
|
| 20 | |||
| 21 | 1 | foreach ($middlewares as $middleware) { |
|
| 22 | 1 | $handlerStack->push($middleware); |
|
| 23 | } |
||
| 24 | |||
| 25 | 1 | $clientRegistry->set( |
|
| 26 | 1 | $name, |
|
| 27 | 1 | new Client(['base_uri' => $baseUri, 'defaults' => $defaults, 'handler' => $handlerStack]) |
|
| 28 | ); |
||
| 30 | } |