Passed
Pull Request — main (#348)
by
unknown
26:19 queued 11:19
created

Point   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Test Coverage

Coverage 50%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 4
c 1
b 0
f 1
dl 0
loc 21
ccs 4
cts 8
cp 0.5
rs 10
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getX() 0 3 1
A __toString() 0 3 1
A __construct() 0 4 1
A getY() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace MartinGeorgiev\ValueObject;
6
7
/**
8
 * @since 3.1
9
 *
10
 * @author Martin Georgiev <[email protected]>
11
 */
12
final class Point
13
{
14 6
    public function __construct(
15
        private float $x,
16
        private float $y,
17
    ) {
18 6
    }
19
20
    public function getX(): float
21
    {
22
        return $this->x;
23
    }
24
25
    public function getY(): float
26
    {
27
        return $this->y;
28
    }
29
30 7
    public function __toString(): string
31
    {
32 7
        return \sprintf('(%s, %s)', $this->x, $this->y);
33
    }
34
}
35