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