CheckrServiceProvider   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Importance

Changes 2
Bugs 1 Features 0
Metric Value
wmc 4
eloc 9
c 2
b 1
f 0
dl 0
loc 29
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A provides() 0 3 1
A boot() 0 5 1
A register() 0 8 2
1
<?php
2
3
namespace Lyal\Checkr\Laravel;
4
5
use Illuminate\Support\Facades\App;
6
use Illuminate\Support\ServiceProvider;
7
use Lyal\Checkr\Client;
8
use Lyal\Checkr\Laravel\Http\Middleware\Webhook;
9
10
class CheckrServiceProvider extends ServiceProvider
11
{
12
    public function boot()
13
    {
14
        $this->loadRoutesFrom(__DIR__.'/Routes/api.php');
15
        $this->publishes([
16
            __DIR__.'/Config/checkr.php' => config_path('checkr.php'),
0 ignored issues
show
Bug introduced by
The function config_path 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

16
            __DIR__.'/Config/checkr.php' => /** @scrutinizer ignore-call */ config_path('checkr.php'),
Loading history...
17
        ]);
18
    }
19
20
    public function register()
21
    {
22
        $this->app['router']->aliasMiddleware('checkr_webhook', Webhook::class);
23
24
        $this->app->bind('lyal.checkr', function () {
25
            $key = App::environment('production') ? config('checkr.production_key') : config('checkr.testing_key');
0 ignored issues
show
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

25
            $key = App::environment('production') ? /** @scrutinizer ignore-call */ config('checkr.production_key') : config('checkr.testing_key');
Loading history...
26
27
            return new Client($key, config('checkr.options', []));
28
        });
29
    }
30
31
    /**
32
     * Get the services provided by the provider.
33
     *
34
     * @return array
35
     */
36
    public function provides()
37
    {
38
        return [Client::class];
39
    }
40
}
41