ServiceProvider   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Test Coverage

Coverage 90%

Importance

Changes 2
Bugs 0 Features 1
Metric Value
eloc 8
c 2
b 0
f 1
dl 0
loc 19
ccs 9
cts 10
cp 0.9
rs 10
wmc 4

2 Methods

Rating   Name   Duplication   Size   Complexity  
A boot() 0 4 2
A register() 0 9 2
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