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.

ServiceProvider   A
last analyzed

Complexity

Total Complexity 7

Size/Duplication

Total Lines 76
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 17
c 1
b 0
f 0
dl 0
loc 76
ccs 0
cts 26
cp 0
rs 10
wmc 7

6 Methods

Rating   Name   Duplication   Size   Complexity  
A publishGroups() 0 5 1
A register() 0 5 1
A registerLoader() 0 4 1
A boot() 0 4 2
A setupBindings() 0 4 1
A registerManager() 0 8 1
1
<?php
2
3
namespace NStack;
4
5
use Illuminate\Support\Str;
6
use Illuminate\Translation\TranslationServiceProvider;
7
use NStack\Translation\NStackLoader;
8
9
/**
10
 * Class ServiceProvider.
11
 */
12
class ServiceProvider extends TranslationServiceProvider
13
{
14
    /**
15
     * boot
16
     *
17
     * @author Casper Rasmussen <[email protected]>
18
     */
19
    public function boot()
20
    {
21
        if (!Str::contains($this->app->version(), 'Lumen')) {
22
            $this->publishGroups();
23
        }
24
    }
25
26
    /**
27
     * register
28
     *
29
     * @author Casper Rasmussen <[email protected]>
30
     */
31
    public function register()
32
    {
33
        $this->registerManager();
34
        $this->setupBindings();
35
        parent::register();
36
    }
37
38
    /**
39
     * publishGroups
40
     *
41
     * @author Casper Rasmussen <[email protected]>
42
     */
43
    protected function publishGroups()
44
    {
45
        $this->publishes([
46
            __DIR__.'/../config' => config_path(),
47
        ], 'config');
48
    }
49
50
    /**
51
     * Setup container binding.
52
     *
53
     * @return void
54
     * @author Casper Rasmussen <[email protected]>
55
     */
56
    protected function setupBindings()
57
    {
58
        $this->app->bind(NStack::class, function ($app) {
59
            return $app['nstack'];
60
        });
61
    }
62
63
    /**
64
     * {@inheritDoc}
65
     * @see \Illuminate\Translation\TranslationServiceProvider::registerLoader()
66
     */
67
    protected function registerLoader()
68
    {
69
        $this->app->singleton('translation.loader', function ($app) {
70
            return new NStackLoader($app['files'], $app['path.lang'], $app->get('nstack'));
71
        });
72
    }
73
74
    /**
75
     * Register assets manager.
76
     *
77
     * @return void
78
     * @author Casper Rasmussen <[email protected]>
79
     */
80
    public function registerManager()
81
    {
82
        $this->app->singleton('nstack', function () {
83
            $configArray = config('nstack');
84
85
            $config = Config::createFromArray($configArray);
86
87
            return new NStack($config);
88
        });
89
    }
90
}
91