HttpClientServiceProvider   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 3
c 1
b 0
f 0
dl 0
loc 14
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A register() 0 4 1
1
<?php
2
3
namespace Freyo\ApiGateway\Kernel\Providers;
4
5
use GuzzleHttp\Client;
6
use Pimple\Container;
7
use Pimple\ServiceProviderInterface;
8
9
class HttpClientServiceProvider implements ServiceProviderInterface
10
{
11
    /**
12
     * Registers services on the given container.
13
     *
14
     * This method should only be used to configure services and parameters.
15
     * It should not get services.
16
     *
17
     * @param Container $pimple A container instance
18
     */
19
    public function register(Container $pimple)
20
    {
21
        $pimple['http_client'] = function ($app) {
22
            return new Client($app['config']->get('http', []));
23
        };
24
    }
25
}
26