Completed
Push — master ( c3f7f6...458bfd )
by Changwan
02:39
created

GuzzleServiceProvider   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
dl 0
loc 13
ccs 0
cts 5
cp 0
rs 10
c 0
b 0
f 0
wmc 1
lcom 0
cbo 4

1 Method

Rating   Name   Duplication   Size   Complexity  
A register() 0 7 1
1
<?php
2
namespace Wandu\Service\GuzzleHttp;
3
4
use GuzzleHttp\Client;
5
use GuzzleHttp\ClientInterface;
6
use Wandu\Config\Contracts\Config;
7
use Wandu\DI\ContainerInterface;
8
use Wandu\DI\ServiceProvider;
9
10
class GuzzleServiceProvider extends ServiceProvider
11
{
12
    /**
13
     * {@inheritdoc}
14
     */
15
    public function register(ContainerInterface $app)
16
    {
17
        $app->bind(Client::class, function (Config $config) {
18
            return new Client($config->get('guzzlehttp.guzzle', []));
19
        });
20
        $app->alias(ClientInterface::class, Client::class);
21
    }
22
}
23