WithHeaderResponseExporter   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 5
c 1
b 0
f 0
dl 0
loc 17
ccs 4
cts 4
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A exporter() 0 7 2
1
<?php declare(strict_types=1);
2
3
4
namespace Pitchart\Phlunit\Constraint\HttpResponse;
5
6
use Pitchart\Phlunit\Exporter\HttpResponseExporter;
7
use SebastianBergmann\Exporter\Exporter;
8
9
trait WithHeaderResponseExporter
10
{
11
    /**
12
     * @var ?HttpResponseExporter
13
     */
14
    private $responseExporter;
15
16
    /**
17
     * @return \Pitchart\Phlunit\Exporter\HttpResponseExporter
18
     */
19 2
    protected function exporter(): Exporter
20
    {
21 2
        if ($this->responseExporter === null) {
22 2
            $this->responseExporter = new HttpResponseExporter(true);
23
        }
24
25 2
        return $this->responseExporter;
26
    }
27
}
28