HttpClientProvider   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
c 1
b 0
f 0
lcom 0
cbo 2
dl 0
loc 13
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A register() 0 10 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