| Conditions | 2 |
| Paths | 2 |
| Total Lines | 12 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 18 | protected static function di(): Container |
||
| 19 | { |
||
| 20 | $container = DI::make('elasticsearch'); |
||
| 21 | if ($container == null) { |
||
| 22 | DI::bind('elasticsearch', function () { |
||
| 23 | $client = ClientBuilder::create()->build(); |
||
| 24 | return new Container(new ElasticsearchRepository($client), new RuntimeCacheRepository()); |
||
| 25 | }, DI::SINGLETON); |
||
| 26 | $container = DI::make('elasticsearch'); |
||
| 27 | } |
||
| 28 | return $container; |
||
| 29 | } |
||
| 30 | |||
| 40 | } |