Entry   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 10
dl 0
loc 29
ccs 11
cts 11
cp 1
rs 10
c 0
b 0
f 0
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getResponse() 0 3 1
A getDuration() 0 3 1
A getRequest() 0 3 1
A __construct() 0 5 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Buzz\Middleware\History;
6
7
use Psr\Http\Message\RequestInterface;
8
use Psr\Http\Message\ResponseInterface;
9
10
class Entry
11
{
12
    private $request;
13
    private $response;
14
    private $duration;
15
16
    /**
17
     * @param float|null $duration The duration in seconds
18
     */
19 4
    public function __construct(RequestInterface $request, ResponseInterface $response, float $duration = null)
20
    {
21 4
        $this->request = $request;
22 4
        $this->response = $response;
23 4
        $this->duration = $duration;
24 4
    }
25
26 3
    public function getRequest(): RequestInterface
27
    {
28 3
        return $this->request;
29
    }
30
31 2
    public function getResponse(): ResponseInterface
32
    {
33 2
        return $this->response;
34
    }
35
36 2
    public function getDuration(): ?float
37
    {
38 2
        return $this->duration;
39
    }
40
}
41