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
Pull Request — master (#180)
by Rias
01:33
created

Replacer::getValue()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace Spatie\ResponseCache;
4
5
use Spatie\ResponseCache\Exceptions\InvalidReplacer;
6
7
class Replacer
8
{
9
    /** @var string */
10
    private $key;
11
12
    /** @var string */
13
    private $value;
14
15
    public function __construct(string $key, callable $callback)
16
    {
17
        if (!is_string($value = $callback())) {
18
            throw InvalidReplacer::callbackString();
19
        }
20
21
        $this->key = $key;
22
        $this->value = $value;
23
    }
24
25
    /**
26
     * @return string
27
     */
28
    public function getKey(): string
29
    {
30
        return $this->key;
31
    }
32
33
    /**
34
     * @return string
35
     */
36
    public function getValue(): string
37
    {
38
        return $this->value;
39
    }
40
}
41