| Conditions | 2 |
| Paths | 1 |
| Total Lines | 22 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 27 | public function register() |
||
| 28 | { |
||
| 29 | $this->mergeConfigFrom(__DIR__.'/config/laravel-stat-search-analytics.php', 'laravel-stat-search-analytics'); |
||
| 30 | |||
| 31 | $statConfig = config('laravel-stat-search-analytics'); |
||
| 32 | |||
| 33 | $this->app->bind(StatClient::class, function () use ($statConfig) { |
||
| 34 | if (empty($statConfig['key'])) { |
||
| 35 | throw InvalidConfiguration::keyNotSpecified(); |
||
| 36 | } |
||
| 37 | |||
| 38 | return StatClientFactory::createForConfig($statConfig); |
||
| 39 | }); |
||
| 40 | |||
| 41 | $this->app->bind(Stat::class, function () { |
||
| 42 | $client = app(StatClient::class); |
||
| 43 | |||
| 44 | return new Stat($client); |
||
| 45 | }); |
||
| 46 | |||
| 47 | $this->app->alias(Stat::class, 'laravel-stat-search-analytics'); |
||
| 48 | } |
||
| 49 | } |
||
| 50 |