Completed
Push — master ( 717b1b...de6dfe )
by Dmitry
06:37
created

Etcd   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A register() 0 6 1
1
<?php
2
3
namespace Basis\Providers;
4
5
use League\Container\ServiceProvider\AbstractServiceProvider;
6
use LinkORB\Component\Etcd\Client;
7
8
class Etcd extends AbstractServiceProvider
9
{
10
    protected $provides = [
11
        Client::class,
12
    ];
13
14
    public function register()
15
    {
16 1
        $this->getContainer()->share(Client::class, function () {
17 1
            return new Client('http://'.getenv('ETCD_SERVICE_HOST').':'.getenv('ETCD_SERVICE_PORT'));
18 1
        });
19
    }
20
}