Code Coverage |
||||||||||
Classes and Traits |
Functions and Methods |
Lines |
||||||||
Total | |
100.00% |
1 / 1 |
|
100.00% |
2 / 2 |
CRAP | |
100.00% |
8 / 8 |
SiteGeneratorServiceProvider | |
100.00% |
1 / 1 |
|
100.00% |
2 / 2 |
3 | |
100.00% |
8 / 8 |
boot | |
100.00% |
1 / 1 |
1 | |
100.00% |
2 / 2 |
|||
register | |
100.00% |
1 / 1 |
2 | |
100.00% |
6 / 6 |
1 | <?php |
2 | |
3 | namespace Qmp\Laravel\SiteGeneratorSponsors\Providers; |
4 | |
5 | use Illuminate\Support\ServiceProvider; |
6 | use Qmp\Laravel\MicroService\DbConnection\DbConnection; |
7 | use Qmp\Laravel\SiteGeneratorSponsors\Retriever\InterfaceProvider; |
8 | use Qmp\Laravel\SiteGeneratorSponsors\Retriever\DigitalV2Provider; |
9 | |
10 | class SiteGeneratorServiceProvider extends ServiceProvider |
11 | { |
12 | /** |
13 | * Boot the service provider. |
14 | * |
15 | * @return void |
16 | */ |
17 | public function boot() |
18 | { |
19 | $this->loadMigrationsFrom(__DIR__.'/../database/migrations/'); |
20 | } |
21 | |
22 | |
23 | public function register() |
24 | { |
25 | DbConnection::mergeFromFile(realpath(__DIR__.'/../../config/connection.php')); |
26 | |
27 | $this->app->singleton(InterfaceProvider::class, function ($app) { |
28 | switch (config('site-generator.sponsors_retriever_provider')) { |
29 | default: return new DigitalV2Provider(config('app.env')); |
30 | } |
31 | }); |
32 | } |
33 | } |