Every8dServiceProvider::register()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 8
ccs 0
cts 5
cp 0
rs 9.4285
c 1
b 0
f 0
cc 1
eloc 4
nc 1
nop 0
crap 2
1
<?php
2
3
namespace Recca0120\Every8d;
4
5
use Illuminate\Support\Arr;
6
use Illuminate\Support\ServiceProvider;
7
8
class Every8dServiceProvider extends ServiceProvider
9
{
10
    public function register()
11
    {
12
        $this->app->singleton(Client::class, function ($app) {
13
            $config = Arr::get($app['config'], 'services.every8d', []);
14
15
            return new Client(Arr::get($config, 'user_id'), Arr::get($config, 'password'));
16
        });
17
    }
18
}
19