RowEventFactory   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 6
c 0
b 0
f 0
dl 0
loc 17
ccs 7
cts 7
cp 1
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A makeRowEvent() 0 6 1
A __construct() 0 5 1
1
<?php
2
declare(strict_types=1);
3
4
namespace MySQLReplication\Event\RowEvent;
5
6
use MySQLReplication\BinaryDataReader\BinaryDataReader;
7
use MySQLReplication\Event\EventInfo;
8
use MySQLReplication\Repository\RepositoryInterface;
9
use Psr\SimpleCache\CacheInterface;
10
11
class RowEventFactory
12
{
13
    private $rowEventBuilder;
14
15 58
    public function __construct(
16
        RepositoryInterface $repository,
17
        CacheInterface $cache
18
    ) {
19 58
        $this->rowEventBuilder = new RowEventBuilder($repository, $cache);
20 58
    }
21
22 54
    public function makeRowEvent(BinaryDataReader $package, EventInfo $eventInfo): RowEvent
23
    {
24 54
        $this->rowEventBuilder->withPackage($package);
25 54
        $this->rowEventBuilder->withEventInfo($eventInfo);
26
27 54
        return $this->rowEventBuilder->build();
28
    }
29
}