Passed
Push — 1.0.0 ( 447710...d7e11c )
by Alex
02:06
created

Coordinates::fromValues()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 3
c 1
b 0
f 0
nc 1
nop 2
dl 0
loc 5
ccs 4
cts 4
cp 1
crap 1
rs 10
1
<?php
2
3
namespace StraTDeS\VO\Single;
4
5
class Coordinates
6
{
7
    private CoordinatesLongitude $longitude;
8
    private CoordinatesLatitude $latitude;
9
10 3
    private function __construct(CoordinatesLongitude $longitude, CoordinatesLatitude $latitude)
11
    {
12 3
        $this->longitude = $longitude;
13 3
        $this->latitude = $latitude;
14 3
    }
15
16 3
    public static function fromValues(float $longitude, float $latitude): Coordinates
17
    {
18 3
        return new self(
19 3
            CoordinatesLongitude::fromValue($longitude),
20 3
            CoordinatesLatitude::fromValue($latitude)
21
        );
22
    }
23
24 1
    public function longitude(): CoordinatesLongitude
25
    {
26 1
        return $this->longitude;
27
    }
28
29 1
    public function latitude(): CoordinatesLatitude
30
    {
31 1
        return $this->latitude;
32
    }
33
}
34