| Conditions | 2 |
| Paths | 1 |
| Total Lines | 23 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 15 | public function register(): void |
||
| 16 | { |
||
| 17 | // Register ManticoreSearchService as singleton |
||
| 18 | $this->app->singleton(ManticoreSearchService::class, function ($app) { |
||
|
|
|||
| 19 | return new ManticoreSearchService(); |
||
| 20 | }); |
||
| 21 | |||
| 22 | // Register ElasticSearchService as singleton |
||
| 23 | $this->app->singleton(ElasticSearchService::class, function ($app) { |
||
| 24 | return new ElasticSearchService(); |
||
| 25 | }); |
||
| 26 | |||
| 27 | // Bind the interface to the appropriate implementation based on config |
||
| 28 | $this->app->singleton(SearchServiceInterface::class, function ($app) { |
||
| 29 | if (config('nntmux.elasticsearch_enabled') === true) { |
||
| 30 | return $app->make(ElasticSearchService::class); |
||
| 31 | } |
||
| 32 | |||
| 33 | return $app->make(ManticoreSearchService::class); |
||
| 34 | }); |
||
| 35 | |||
| 36 | // Register alias for ManticoreSearch (for backward compatibility) |
||
| 37 | $this->app->alias(ManticoreSearchService::class, 'manticore'); |
||
| 38 | } |
||
| 49 |
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.