VodafoneServiceProvider::boot()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 0

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
cc 1
eloc 0
c 2
b 0
f 0
nc 1
nop 0
dl 0
loc 2
rs 10
1
<?php
2
3
namespace NotificationChannels\Vodafone;
4
5
use Illuminate\Support\ServiceProvider;
6
7
class VodafoneServiceProvider extends ServiceProvider
8
{
9
    protected $defer = true;
10
11
    /**
12
     * Bootstrap the application services.
13
     */
14
    public function boot()
15
    {
16
    }
17
18
    /**
19
     * Register the application services.
20
     */
21
    public function register()
22
    {
23
        $this->app->bind(VodafoneClient::class, function () {
24
            return new VodafoneClient(config('services.vodafone.username'), config('services.vodafone.password'));
0 ignored issues
show
Unused Code introduced by
The call to NotificationChannels\Vod...neClient::__construct() has too many arguments starting with config('services.vodafone.username'). ( Ignorable by Annotation )

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

24
            return /** @scrutinizer ignore-call */ new VodafoneClient(config('services.vodafone.username'), config('services.vodafone.password'));

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. Please note the @ignore annotation hint above.

Loading history...
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

24
            return new VodafoneClient(/** @scrutinizer ignore-call */ config('services.vodafone.username'), config('services.vodafone.password'));
Loading history...
25
        });
26
    }
27
}
28