Passed
Pull Request — master (#14)
by Craig
32:44
created

InterfaxServiceProvider::boot()   A

Complexity

Conditions 2
Paths 1

Size

Total Lines 15
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 2.864

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 9
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 15
ccs 4
cts 10
cp 0.4
crap 2.864
rs 9.9666
1
<?php
2
3
namespace NotificationChannels\Interfax;
4
5
use Illuminate\Support\ServiceProvider;
6
use Interfax\Client;
7
8
class InterfaxServiceProvider extends ServiceProvider
9
{
10 18
    public function boot()
11
    {
12 18
        $this->app->when(InterfaxChannel::class)
0 ignored issues
show
Bug introduced by
The method when() does not exist on Tests\Laravel\App. ( Ignorable by Annotation )

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

12
        $this->app->/** @scrutinizer ignore-call */ 
13
                    when(InterfaxChannel::class)

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
13 18
            ->needs(Client::class)
14 18
            ->give(function () {
15
                $options = [
16
                    'username' => config('services.interfax.username'),
17
                    'password' => config('services.interfax.password'),
18
                ];
19
20
                if (config('services.interfax.pci')) {
21
                    $options['base_uri'] = 'https://rest-sl.interfax.net';
22
                }
23
24
                return new Client($options);
25
            });
26
    }
27
}
28