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

DefaultHasher   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 2
dl 0
loc 17
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getHashFor() 0 6 1
1
<?php
2
3
namespace Spatie\ResponseCache\Hasher;
4
5
use Illuminate\Http\Request;
6
use Spatie\ResponseCache\CacheProfiles\CacheProfile;
7
8
class DefaultHasher implements RequestHasher
9
{
10
    /** @var \Spatie\ResponseCache\CacheProfiles\CacheProfile */
11
    protected $cacheProfile;
12
13
    public function __construct(CacheProfile $cacheProfile)
14
    {
15
        $this->cacheProfile = $cacheProfile;
16
    }
17
18
    public function getHashFor(Request $request): string
19
    {
20
        return 'responsecache-'.md5(
21
            "{$request->getHost()}-{$request->getRequestUri()}-{$request->getMethod()}/".$this->cacheProfile->useCacheNameSuffix($request)
22
        );
23
    }
24
}
25