Passed
Push — master ( ea72f9...4e305a )
by Pieter
06:03
created

Factory::build()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 8
ccs 4
cts 4
cp 1
rs 9.4285
c 1
b 0
f 0
cc 1
eloc 4
nc 1
nop 1
crap 1
1
<?php declare(strict_types = 1);
2
3
namespace ekinhbayar\GitAmp\Response;
4
5
use ekinhbayar\GitAmp\Events\Factory as EventFactory;
6
use Amp\Artax\Response;
7
use Psr\Log\LoggerInterface;
8
9
class Factory
10
{
11
    private $eventFactory;
12
13
    private $logger;
14
15 2
    public function __construct(EventFactory $eventFactory, LoggerInterface $logger)
16
    {
17 2
        $this->eventFactory = $eventFactory;
18 2
        $this->logger       = $logger;
19
    }
20
21 2
    public function build(Response $response): Results
22
    {
23 2
        $results = new Results($this->eventFactory, $this->logger);
24
25 2
        $results->appendResponse($response);
26
27 2
        return $results;
28
    }
29
}
30