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.

ResponseCacheServiceProvider::boot()   A
last analyzed

Complexity

Conditions 3
Paths 2

Size

Total Lines 37

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 37
rs 9.328
c 0
b 0
f 0
cc 3
nc 2
nop 0
1
<?php
2
3
namespace Spatie\ResponseCache;
4
5
use Illuminate\Cache\Repository;
6
use Illuminate\Container\Container;
7
use Illuminate\Support\ServiceProvider;
8
use Spatie\ResponseCache\CacheProfiles\CacheProfile;
9
use Spatie\ResponseCache\Commands\ClearCommand;
10
use Spatie\ResponseCache\Hasher\RequestHasher;
11
use Spatie\ResponseCache\Serializers\Serializer;
12
13
class ResponseCacheServiceProvider extends ServiceProvider
14
{
15
    public function boot()
16
    {
17
        $this->publishes([
18
            __DIR__.'/../config/responsecache.php' => config_path('responsecache.php'),
19
        ], 'config');
20
21
        $this->app->bind(CacheProfile::class, function (Container $app) {
22
            return $app->make(config('responsecache.cache_profile'));
23
        });
24
25
        $this->app->bind(RequestHasher::class, function (Container $app) {
26
            return $app->make(config('responsecache.hasher'));
27
        });
28
29
        $this->app->bind(Serializer::class, function (Container $app) {
30
            return $app->make(config('responsecache.serializer'));
31
        });
32
33
        $this->app->when(ResponseCacheRepository::class)
34
            ->needs(Repository::class)
35
            ->give(function (): Repository {
36
                $repository = app('cache')->store(config('responsecache.cache_store'));
37
                if (! empty(config('responsecache.cache_tag'))) {
38
                    return $repository->tags(config('responsecache.cache_tag'));
39
                }
40
41
                return $repository;
42
            });
43
44
        $this->app->singleton('responsecache', ResponseCache::class);
45
46
        if ($this->app->runningInConsole()) {
47
            $this->commands([
48
                ClearCommand::class,
49
            ]);
50
        }
51
    }
52
53
    public function register()
54
    {
55
        $this->mergeConfigFrom(__DIR__.'/../config/responsecache.php', 'responsecache');
56
    }
57
}
58