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