QueryFiltersServiceProvider::boot()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 13
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 7
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 6
c 1
b 0
f 0
nc 2
nop 0
dl 0
loc 13
ccs 7
cts 7
cp 1
crap 2
rs 10
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