QueryFiltersServiceProvider   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 7
c 1
b 0
f 0
dl 0
loc 20
ccs 7
cts 7
cp 1
rs 10
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A boot() 0 13 2
1
<?php
2
3
namespace Cerbero\QueryFilters\Providers;
4
5
use Cerbero\QueryFilters\Console\Commands\MakeQueryFiltersCommand;
6
use Illuminate\Support\ServiceProvider;
7
8
/**
9
 * The query filters service provider.
10
 *
11
 */
12
class QueryFiltersServiceProvider extends ServiceProvider
13
{
14
    /**
15
     * Bootstrap the application services.
16
     *
17
     * @return void
18
     */
19 9
    public function boot()
20
    {
21
        // determine where to publish the configuration, if requested
22 9
        $this->publishes([
23 9
            __DIR__ . '/../../config/query_filters.php' => config_path('query_filters.php'),
24 9
        ], 'query_filters_config');
25
26
        // merge the published configuration with the package default one
27 9
        $this->mergeConfigFrom(__DIR__ . '/../../config/query_filters.php', 'query_filters');
28
29
        // register console command when running Artisan
30 9
        if ($this->app->runningInConsole()) {
31 9
            $this->commands(MakeQueryFiltersCommand::class);
32 3
        }
33 9
    }
34
}
35