Completed
Push — master ( ce37f0...8d1c08 )
by Andrea Marco
05:00 queued 12s
created

QueryFiltersServiceProvider::boot()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 15

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 9
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 15
ccs 9
cts 9
cp 1
rs 9.7666
c 0
b 0
f 0
cc 2
nc 2
nop 0
crap 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