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.

GoogleTagManagerServiceProvider::boot()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 17

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 17
rs 9.7
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace Spatie\GoogleTagManager;
4
5
use Illuminate\Support\ServiceProvider;
6
use Spatie\GoogleTagManager\GoogleTagManager;
7
8
class GoogleTagManagerServiceProvider extends ServiceProvider
9
{
10
    /**
11
     * Bootstrap the application services.
12
     */
13
    public function boot()
14
    {
15
        $this->loadViewsFrom(__DIR__.'/../resources/views', 'googletagmanager');
16
17
        $this->publishes([
18
            __DIR__.'/../resources/config/config.php' => config_path('googletagmanager.php'),
19
        ], 'config');
20
21
        $this->publishes([
22
            __DIR__.'/../resources/views' => base_path('resources/views/vendor/googletagmanager'),
23
        ], 'views');
24
25
        $this->app['view']->creator(
26
            ['googletagmanager::head', 'googletagmanager::body', 'googletagmanager::script'],
27
            'Spatie\GoogleTagManager\ScriptViewCreator'
28
        );
29
    }
30
31
    /**
32
     * Register the application services.
33
     */
34
    public function register()
35
    {
36
        $this->mergeConfigFrom(__DIR__.'/../resources/config/config.php', 'googletagmanager');
37
38
        $googleTagManager = new GoogleTagManager(config('googletagmanager.id'));
39
40
        if (config('googletagmanager.enabled') === false) {
41
            $googleTagManager->disable();
42
        }
43
44
        $this->app->instance('Spatie\GoogleTagManager\GoogleTagManager', $googleTagManager);
45
        $this->app->alias('Spatie\GoogleTagManager\GoogleTagManager', 'googletagmanager');
46
47
        if (is_file(config('googletagmanager.macroPath'))) {
48
            include config('googletagmanager.macroPath');
49
        }
50
    }
51
}
52