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

Factory   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
lcom 1
cbo 1
dl 0
loc 21
ccs 7
cts 7
cp 1
rs 10
c 1
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A build() 0 8 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