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::boot()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 12

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 12
rs 9.8666
c 0
b 0
f 0
cc 2
nc 2
nop 0
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