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 ( bb02f6...a7b600 )
by
unknown
05:20 queued 04:01
created

CorsServiceProvider   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A boot() 0 16 3
A register() 0 4 1
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 CorsServiceProvider 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