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.
Completed
Push — master ( 02f07d...0e7d0b )
by Freek
01:47
created

BaseCacheProfile::useCacheNameSuffix()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 8
rs 10
c 0
b 0
f 0
cc 2
nc 2
nop 1
1
<?php
2
3
namespace Spatie\ResponseCache\CacheProfiles;
4
5
use DateTime;
6
use Carbon\Carbon;
7
use Illuminate\Http\Request;
8
use Illuminate\Support\Facades\Auth;
9
10
abstract class BaseCacheProfile implements CacheProfile
11
{
12
    public function enabled(Request $request): bool
13
    {
14
        return config('responsecache.enabled');
15
    }
16
17
    public function cacheRequestUntil(Request $request): DateTime
18
    {
19
        return Carbon::now()->addSeconds(
20
            config('responsecache.cache_lifetime_in_seconds')
21
        );
22
    }
23
24
    public function useCacheNameSuffix(Request $request): string
25
    {
26
        if (Auth::check()) {
27
            return Auth::user()->id;
28
        }
29
30
        return '';
31
    }
32
33
    public function isRunningInConsole(): bool
34
    {
35
        if (app()->environment('testing')) {
36
            return false;
37
        }
38
39
        return app()->runningInConsole();
40
    }
41
}
42