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