| Conditions | 3 |
| Paths | 1 |
| Total Lines | 13 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 3.1825 |
| Changes | 0 | ||
| 1 | <?php |
||
| 17 | 1 | public function register() |
|
| 18 | { |
||
| 19 | $this->getContainer()->share(Client::class, function () { |
||
| 20 | 1 | $host = getenv('ETCD_SERVICE_HOST') ?: 'etcd'; |
|
| 21 | 1 | $port = getenv('ETCD_SERVICE_PORT') ?: 2379; |
|
| 22 | 1 | return new Client("http://$host:$port"); |
|
| 23 | 1 | }); |
|
| 24 | 1 | $this->getContainer()->share(Etcd::class, function () { |
|
| 25 | $client = $this->getContainer()->get(Client::class); |
||
| 26 | $config = $this->getContainer()->get(Config::class); |
||
| 27 | return new Etcd($client, $config); |
||
| 28 | 1 | }); |
|
| 29 | 1 | } |
|
| 30 | } |
||
| 31 |