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.
Completed
Push — master ( 968ce1...2eaf6d )
by Freek
06:49 queued 05:16
created

CorsLiteServiceProvider::boot()   A

Complexity

Conditions 3
Paths 4

Size

Total Lines 16
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 16
rs 9.4285
c 0
b 0
f 0
cc 3
eloc 9
nc 4
nop 0
1
<?php
2
3
namespace Spatie\Cors;
4
5
use Illuminate\Support\ServiceProvider;
6
use Spatie\Cors\CorsProfile\CorsProfile;
7
use Spatie\Cors\CorsProfile\DefaultProfile;
8
use Spatie\Cors\Exceptions\InvalidCorsProfile;
9
10
class CorsLiteServiceProvider extends ServiceProvider
11
{
12
    public function boot()
13
    {
14
        if ($this->app->runningInConsole()) {
15
            $this->publishes([
16
                __DIR__.'/../config/cors.php' => config_path('cors.php'),
17
            ], 'config');
18
        }
19
20
        $configuredCorsProfile = config('cors.cors_profile');
21
22
        if (! is_a($configuredCorsProfile, DefaultProfile::class, true)) {
23
            throw InvalidCorsProfile::profileDoesNotExtendDefaultProfile($configuredCorsProfile);
24
        }
25
26
        $this->app->bind(CorsProfile::class, $configuredCorsProfile);
27
    }
28
29
    public function register()
30
    {
31
        $this->mergeConfigFrom(__DIR__.'/../config/cors.php', 'cors');
32
    }
33
}
34