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 3

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 3
eloc 7
dl 0
loc 29
c 0
b 0
f 0
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A boot() 0 8 1
A provides() 0 2 1
A register() 0 4 1
1
<?php
2
3
namespace Scuttlebyte\ContextManager\Laravel;
4
5
use http\Env\Request;
6
use Scuttlebyte\ContextManager\ContextManager;
7
8
class ServiceProvider extends \Illuminate\Support\ServiceProvider
9
{
10
    /**
11
     * Register bindings in the container.
12
     *
13
     * @return void
14
     */
15
    public function register()
16
    {
17
        $this->app->singleton(ContextManager::class, function ($app) {
0 ignored issues
show
Unused Code introduced by
The parameter $app is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

17
        $this->app->singleton(ContextManager::class, function (/** @scrutinizer ignore-unused */ $app) {

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
18
            return new ContextManager();
19
        });
20
    }
21
22
    public function provides() {
23
        return [ContextManager::class];
24
    }
25
26
    /**
27
     * Boot methods for the package
28
     */
29
    public function boot()
30
    {
31
        // Laravel takes over `$this` context over in the macro closure,
32
        // so we have to bind $this->app to a variable here instead.
33
        $app = $this->app;
34
35
        $this->app['request']->macro('context', function () use ($app) {
36
            return $app[ContextManager::class];
37
        });
38
    }
39
}
40