Passed
Pull Request — main (#348)
by
unknown
15:46 queued 49s
created

Point   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 20
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 20
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 6
    ) {}
18
19 7
    public function __toString(): string
20
    {
21 7
        return \sprintf('(%f, %f)', $this->x, $this->y);
22
    }
23
24
    public function getX(): float
25
    {
26
        return $this->x;
27
    }
28
29
    public function getY(): float
30
    {
31
        return $this->y;
32
    }
33
}
34