| Conditions | 3 |
| Paths | 1 |
| Total Lines | 19 |
| Code Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 20 | 1 | public function register() |
|
| 21 | { |
||
| 22 | $this->getContainer()->share(Client::class, function () { |
||
| 23 | 1 | $host = getenv('ETCD_SERVICE_HOST') ?: 'etcd'; |
|
| 24 | 1 | $port = getenv('ETCD_SERVICE_PORT') ?: 2379; |
|
| 25 | 1 | return new Client("http://$host:$port"); |
|
| 26 | 1 | }); |
|
| 27 | $this->getContainer()->share(Event::class, function () { |
||
| 28 | $dispatcher = $this->getContainer()->get(Dispatcher::class); |
||
| 29 | $config = $this->getContainer()->get(Config::class); |
||
| 30 | $spy = $this->getContainer()->get(Spy::class); |
||
| 31 | return new Event($dispatcher, $config, $spy); |
||
| 32 | 1 | }); |
|
| 33 | 1 | $this->getContainer()->share(Service::class, function () { |
|
| 34 | $client = $this->getContainer()->get(Client::class); |
||
| 35 | $config = $this->getContainer()->get(Config::class); |
||
| 36 | return new Service($client, $config); |
||
| 37 | 1 | }); |
|
| 38 | 1 | } |
|
| 39 | } |
||
| 40 |