Passed
Push — master ( 966d85...722ad6 )
by kacper
05:18
created

MasterStatusDTO::getPosition()   A

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 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
1
<?php
2
declare(strict_types=1);
3
4
namespace MySQLReplication\Repository;
5
6
class MasterStatusDTO
7
{
8
    private $position;
9
    private $file;
10
11 57
    public function __construct(
12
        int $position,
13
        string $file
14
    ) {
15 57
        $this->position = $position;
16 57
        $this->file = $file;
17 57
    }
18
19 57
    public static function makeFromArray(array $data): self
20
    {
21 57
        return new self(
22 57
            (int)$data['Position'],
23 57
            (string)$data['File']
24
        );
25
    }
26
27 56
    public function getPosition(): int
28
    {
29 56
        return $this->position;
30
    }
31
32 56
    public function getFile(): string
33
    {
34 56
        return $this->file;
35
    }
36
}