GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

SovrenServiceProvider   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 42
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 4

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 4
dl 0
loc 42
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A boot() 0 12 2
A register() 0 20 1
1
<?php
2
3
namespace Via\LaravelSovren;
4
5
use GuzzleHttp\Client;
6
use Illuminate\Support\ServiceProvider;
7
8
class SovrenServiceProvider extends ServiceProvider
9
{
10
    /**
11
     * Bootstrap the application services.
12
     */
13
    public function boot()
14
    {
15
        if ($this->app->runningInConsole()) {
16
            $this->publishes([
17
                __DIR__.'/../config/sovren.php' => config_path('laravel-sovren.php'),
18
            ], 'config');
19
        }
20
21
        $this->publishes([
22
            __DIR__.'/../config/sovren.php' => config_path('sovren.php'),
23
        ], 'config');
24
    }
25
26
    /**
27
     * Register the application services.
28
     */
29
    public function register(): void
30
    {
31
        // Automatically apply the package configuration
32
        $this->mergeConfigFrom(__DIR__.'/../config/sovren.php', 'sovren');
33
34
        // Register the main class to use with the facade
35
        $this->app->singleton('laravel-sovren', static function () {
36
            $client = new Client([
37
                'base_uri' => config('sovren.sovren-base-uri'),
38
                'headers' => [
39
                    'Accept' => 'application/json',
40
                    'Content-Type' => 'application/json',
41
                    'Sovren-AccountId' => config('sovren.sovren-accountid'),
42
                    'Sovren-ServiceKey' => config('sovren.sovren-servicekey'),
43
                    'User-Agent' => 'Laravel'
44
                ]
45
            ]);
46
            return new Sovren($client);
47
        });
48
    }
49
}
50