History::addFailure()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 2
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 2
crap 1
1
<?php
2
3
declare(strict_types=1);
4
5
/**
6
 * This file is part of Esi\IPQuery.
7
 *
8
 * (c) Eric Sizemore <[email protected]>
9
 *
10
 * This source file is subject to the MIT license. For the full copyright and
11
 * license information, please view the LICENSE file that was distributed with
12
 * this source code.
13
 */
14
15
namespace Esi\IPQuery\HttpClient\Plugin;
16
17
use Http\Client\Common\Plugin\Journal;
18
use Override;
0 ignored issues
show
Bug introduced by
The type Override was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
19
use Psr\Http\Client\ClientExceptionInterface;
20
use Psr\Http\Message\RequestInterface;
21
use Psr\Http\Message\ResponseInterface;
22
23
/**
24
 * @internal
25
 */
26
final class History implements Journal
27
{
28
    private ?ResponseInterface $lastResponse = null;
29
30 1
    #[Override]
31 1
    public function addFailure(RequestInterface $request, ClientExceptionInterface $exception): void {}
32
33 1
    #[Override]
34
    public function addSuccess(RequestInterface $request, ResponseInterface $response): void
35
    {
36 1
        $this->lastResponse = $response;
37
    }
38
39 2
    public function getLastResponse(): ?ResponseInterface
40
    {
41 2
        return $this->lastResponse;
42
    }
43
}
44