TableMap::getTable()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
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 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
}