Passed
Push — develop ( 7cbbb4...22c94d )
by Stephen
02:36
created

FilterServiceProvider::boot()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 5
Bugs 0 Features 0
Metric Value
eloc 2
c 5
b 0
f 0
dl 0
loc 6
ccs 0
cts 3
cp 0
rs 10
cc 1
nc 1
nop 0
crap 2
1
<?php
2
3
namespace Spinen\BrowserFilter;
4
5
use Illuminate\Support\ServiceProvider;
6
7
/**
8
 * Class FilterServiceProvider
9
 *
10
 * @package Spinen\BrowserFilter
11
 */
12
class FilterServiceProvider extends ServiceProvider
13
{
14
    /**
15
     * Location of the configuration file in the package
16
     *
17
     * @var string
18
     */
19
    protected $config_file;
20
21 1
    public function __construct($app)
22
    {
23 1
        parent::__construct($app);
24
25 1
        $this->config_file = realpath(__DIR__ . '/config/browserfilter.php');
26 1
    }
27
28
    /**
29
     * Perform post-registration booting of services.
30
     *
31
     * @return void
32
     */
33
    public function boot()
34
    {
35
        // Publish configuration file
36
        $this->publishes(
37
            [
38
                $this->config_file => $this->app['path.config'] . DIRECTORY_SEPARATOR . 'browserfilter.php',
39
            ]
40
        );
41
    }
42
43
    /**
44
     * Register the service provider.
45
     *
46
     * @return void
47
     */
48
    public function register()
49
    {
50
        // Use default configuration
51
        $this->mergeConfigFrom($this->config_file, 'browserfilter');
52
    }
53
}
54