ServiceProvider::register()   A
last analyzed

Complexity

Conditions 2
Paths 1

Size

Total Lines 9
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 2.0185

Importance

Changes 2
Bugs 0 Features 1
Metric Value
cc 2
eloc 5
c 2
b 0
f 1
nc 1
nop 0
dl 0
loc 9
ccs 5
cts 6
cp 0.8333
crap 2.0185
rs 10
1
<?php
2
3
namespace LaravelLoqate;
4
5
class ServiceProvider extends \Illuminate\Support\ServiceProvider
6
{
7 2
    public function boot()
8
    {
9 2
        if ($this->app->runningInConsole()) {
10 2
            $this->commands([
11 2
            ]);
12
        }
13
    }
14
15 2
    public function register()
16
    {
17 2
        $this->app->bind('loqate-api', function ($app) {
0 ignored issues
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

17
        $this->app->bind('loqate-api', 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...
18 2
            $key = config('services.loqate.key');
19 2
            if (!$key) {
20
                throw new LoqateException('Please specify api key: services.loqate.key');
21
            }
22
23 2
            return new LoqateApi($key);
24 2
        });
25
    }
26
}
27