RowEventFactory   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

2 Methods

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