HttpClientProvider::register()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 10
rs 9.4285
cc 1
eloc 5
nc 1
nop 1
1
<?php
2
namespace Metfan\RabbitSetup\Container;
3
4
use Metfan\RabbitSetup\Factory\CurlClientFactory;
5
use Metfan\RabbitSetup\Http\ClientPool;
6
use Pimple\Container;
7
use Pimple\ServiceProviderInterface;
8
9
10
/**
11
 * Add definition of CurlClientFactory et ClientPool to container
12
 *
13
 * @author Ulrich
14
 * @package Metfan\RabbitSetup\Container
15
 */
16
class HttpClientProvider implements ServiceProviderInterface
17
{
18
    public function register(Container $container)
19
    {
20
        $container['curl_client_factory'] = function($c) {
0 ignored issues
show
Unused Code introduced by
The parameter $c is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
21
            return new CurlClientFactory();
22
        };
23
24
        $container['http_client_pool'] = function($c) {
25
            return new ClientPool($c['curl_client_factory']);
26
        };
27
    }
28
}
29