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 ( ae671f...7094e6 )
by David
02:14
created

InMemoryRecorder   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 22
c 0
b 0
f 0
wmc 3
lcom 1
cbo 0
ccs 8
cts 8
cp 1
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A replay() 0 4 1
A record() 0 4 1
A clear() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Http\Client\Plugin\Vcr\Recorder;
6
7
use Psr\Http\Message\ResponseInterface;
8
9
/**
10
 * Store responses in memory.
11
 *
12
 * @author Gary PEGEOT <[email protected]>
13
 */
14
final class InMemoryRecorder implements PlayerInterface, RecorderInterface
15
{
16
    /**
17
     * @var ResponseInterface[]
18
     */
19
    private $responses = [];
20
21 5
    public function replay(string $name): ?ResponseInterface
22
    {
23 5
        return $this->responses[$name] ?? null;
24
    }
25
26 4
    public function record(string $name, ResponseInterface $response): void
27
    {
28 4
        $this->responses[$name] = $response;
29 4
    }
30
31 1
    public function clear(): void
32
    {
33 1
        $this->responses = [];
34 1
    }
35
}
36