RowEventFactory::makeRowEvent()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 2
dl 0
loc 6
ccs 4
cts 4
cp 1
crap 1
rs 10
c 0
b 0
f 0
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
}