TableMap   A
last analyzed

Complexity

Total Complexity 7

Size/Duplication

Total Lines 53
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

7 Methods

Rating   Name   Duplication   Size   Complexity  
A getTableId() 0 3 1
A jsonSerialize() 0 3 1
A getColumnsAmount() 0 3 1
A __construct() 0 12 1
A getTable() 0 3 1
A getColumnDTOCollection() 0 3 1
A getDatabase() 0 3 1
1
<?php
2
declare(strict_types=1);
3
4
namespace MySQLReplication\Event\RowEvent;
5
6
use JsonSerializable;
7
8
class TableMap implements JsonSerializable
9
{
10
    private $database;
11
    private $table;
12
    private $tableId;
13
    private $columnsAmount;
14
    private $columnDTOCollection;
15
16 55
    public function __construct(
17
        string $database,
18
        string $table,
19
        string $tableId,
20
        int $columnsAmount,
21
        ColumnDTOCollection $columnDTOCollection
22
    ) {
23 55
        $this->database = $database;
24 55
        $this->table = $table;
25 55
        $this->tableId = $tableId;
26 55
        $this->columnsAmount = $columnsAmount;
27 55
        $this->columnDTOCollection = $columnDTOCollection;
28 55
    }
29
30 1
    public function getDatabase(): string
31
    {
32 1
        return $this->database;
33
    }
34
35 2
    public function getTable(): string
36
    {
37 2
        return $this->table;
38
    }
39
40 1
    public function getTableId(): string
41
    {
42 1
        return $this->tableId;
43
    }
44
45 53
    public function getColumnsAmount(): int
46
    {
47 53
        return $this->columnsAmount;
48
    }
49
50
    /**
51
     * @return ColumnDTOCollection|ColumnDTO[]
52
     */
53 54
    public function getColumnDTOCollection(): ColumnDTOCollection
54
    {
55 54
        return $this->columnDTOCollection;
56
    }
57
58 1
    public function jsonSerialize()
59
    {
60 1
        return get_object_vars($this);
61
    }
62
}