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.

UrlSignerServiceProvider::boot()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 24
Code Lines 15

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 13
CRAP Score 1

Importance

Changes 7
Bugs 0 Features 0
Metric Value
eloc 15
c 7
b 0
f 0
dl 0
loc 24
ccs 13
cts 13
cp 1
rs 9.7666
cc 1
nc 1
nop 0
crap 1
1
<?php
2
3
namespace Linkeys\UrlSigner\Providers;
4
5
use Illuminate\Support\Facades\Event;
6
use Illuminate\Support\ServiceProvider;
7
use Linkeys\UrlSigner\Contracts\UrlSigner as UrlSignerContract;
8
use Linkeys\UrlSigner\Contracts\Models\Group as GroupContract;
9
use Linkeys\UrlSigner\Contracts\Models\Link as LinkContract;
10
use Linkeys\UrlSigner\Events\LinkClicked;
11
use Linkeys\UrlSigner\Middleware\AddLinkDataToRequest;
12
use Linkeys\UrlSigner\Middleware\AddLinkToRequest;
13
use Linkeys\UrlSigner\Middleware\CheckLinkUnchanged;
14
use Linkeys\UrlSigner\Middleware\CheckLinkValid;
15
use Linkeys\UrlSigner\Support\GroupRepository\EloquentGroupRepository;
16
use Linkeys\UrlSigner\Support\GroupRepository\GroupRepository;
17
use Linkeys\UrlSigner\Support\LinkRepository\EloquentLinkRepository;
18
use Linkeys\UrlSigner\Support\LinkRepository\LinkRepository;
19
use Linkeys\UrlSigner\UrlSigner;
20
use Linkeys\UrlSigner\Listeners\RecordLinkClick;
21
use Linkeys\UrlSigner\Models\Group;
22
use Linkeys\UrlSigner\Models\Link;
23
use Linkeys\UrlSigner\Support\ExpiryNormaliser\NormaliserManager;
24
use Linkeys\UrlSigner\Support\ExpiryNormaliser\NormaliserManagerContract;
25
use Linkeys\UrlSigner\Support\ExpiryNormaliser\Normalisers\FromDateTime;
26
use Linkeys\UrlSigner\Support\ExpiryNormaliser\Normalisers\FromInteger;
27
use Linkeys\UrlSigner\Support\ExpiryNormaliser\Normalisers\FromString;
28
use Linkeys\UrlSigner\Support\UrlManipulator\SpatieUrlManipulator;
29
use Linkeys\UrlSigner\Support\UrlManipulator\UrlManipulator;
30
use Linkeys\UrlSigner\Support\Uuid\RamseyUuidCreator;
31
use Linkeys\UrlSigner\Support\Uuid\UuidCreator;
32
33
class UrlSignerServiceProvider extends ServiceProvider
34
{
35 73
    public function boot()
36
    {
37
38 73
        $this->publishes([
39 73
            __DIR__.'/../../config/links.php' => config_path('links.php')
40 73
        ], 'config');
41
42 73
        $this->publishes([
43 73
            __DIR__.'/../../database/migrations/' => database_path('migrations')
44 73
        ], 'migrations');
45
	
46 73
        $this->mergeConfigFrom(
47 73
            __DIR__.'/../../config/links.php', 'links'
48
        );
49 73
        $this->loadMigrationsFrom(__DIR__.'/../../database/migrations');
50
51 73
        $this->app['router']->middlewareGroup('link', [
52 73
            AddLinkToRequest::class,
53
            AddLinkDataToRequest::class,
54
            CheckLinkUnchanged::class,
55
            CheckLinkValid::class
56
        ]);
57
58 73
        Event::listen(LinkClicked::class, RecordLinkClick::class);
59 73
    }
60
61 73
    public function register()
62
    {
63 73
        $this->app->bind(UrlSignerContract::class, UrlSigner::class);
64 73
        $this->app->bind(LinkContract::class, Link::class);
65 73
        $this->app->bind(GroupContract::class, Group::class);
66 73
        $this->app->bind(UrlManipulator::class, SpatieUrlManipulator::class);
67 73
        $this->app->bind(UuidCreator::class, RamseyUuidCreator::class);
68 73
        $this->app->bind(LinkRepository::class, EloquentLinkRepository::class);
69 73
        $this->app->bind(GroupRepository::class, EloquentGroupRepository::class);
70
71
72 73
        $normaliserManager = new NormaliserManager();
73 73
        $normaliserManager->pushNormaliser(new FromDateTime);
74 73
        $normaliserManager->pushNormaliser(new FromString);
75 73
        $normaliserManager->pushNormaliser(new FromInteger);
76 73
        $this->app->instance(NormaliserManagerContract::class, $normaliserManager);
77
78 73
        $this->mergeConfigFrom(__DIR__.'/../../config/links.php', config_path('links.php'));
79 73
    }
80
81
}
82