Passed
Pull Request — master (#1)
by Gombos
03:28
created

DripServiceProvider   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
eloc 14
c 0
b 0
f 0
dl 0
loc 30
ccs 0
cts 22
cp 0
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A register() 0 10 1
A boot() 0 7 1
A provides() 0 5 1
1
<?php
2
3
namespace Glorand\Drip\Laravel;
4
5
use Illuminate\Support\ServiceProvider;
6
7
class DripServiceProvider extends ServiceProvider
8
{
9
    protected $defer = true;
10
11
    public function register()
12
    {
13
        $this->app->bind('drip', function ($app) {
1 ignored issue
show
Unused Code introduced by
The parameter $app is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

13
        $this->app->bind('drip', function (/** @scrutinizer ignore-unused */ $app) {

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
14
            return new LaravelDrip(
15
                config('laravel_drip.drip_account_id'),
1 ignored issue
show
Bug introduced by
The function config was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

15
                /** @scrutinizer ignore-call */ 
16
                config('laravel_drip.drip_account_id'),
Loading history...
16
                config('laravel_drip.drip_api_key'),
17
                config('laravel_drip.drip_user_agent')
18
            );
19
        });
20
        $this->app->alias('drip', \Glorand\Drip\Laravel\DripContract::class);
21
    }
22
23
    public function boot()
24
    {
25
        $this->publishes([
26
            __DIR__ . '/../config/laravel_drip.php' => config_path('laravel_drip.php'),
1 ignored issue
show
Bug introduced by
The function config_path was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

26
            __DIR__ . '/../config/laravel_drip.php' => /** @scrutinizer ignore-call */ config_path('laravel_drip.php'),
Loading history...
27
        ]);
28
29
        $this->mergeConfigFrom(__DIR__.'/../config/laravel_drip.php', 'laravel_drip');
30
    }
31
32
    public function provides()
33
    {
34
        return [
35
            \Glorand\Drip\Laravel\DripContract::class,
36
            'drip'
37
        ];
38
    }
39
}
40