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

FilterServiceProvider   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Test Coverage

Coverage 40%

Importance

Changes 5
Bugs 0 Features 0
Metric Value
wmc 3
eloc 7
c 5
b 0
f 0
dl 0
loc 40
ccs 4
cts 10
cp 0.4
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A boot() 0 6 1
A register() 0 4 1
A __construct() 0 5 1
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