Passed
Push — 4.x ( 17e0c5...e9b635 )
by Doug
07:44
created

GeocentricValue   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getZ() 0 3 1
A getX() 0 3 1
A getY() 0 3 1
1
<?php
2
/**
3
 * PHPCoord.
4
 *
5
 * @author Doug Wright
6
 */
7
declare(strict_types=1);
8
9
namespace PHPCoord\CoordinateOperation;
10
11
use PHPCoord\UnitOfMeasure\Length\Length;
12
use PHPCoord\UnitOfMeasure\Length\Metre;
13
14
/**
15
 * A geocentric point w/out a CRS.
16
 * @internal
17
 */
18
class GeocentricValue
19
{
20
    /**
21
     * @var Length
22
     */
23
    private $x;
24
25
    /**
26
     * @var Length
27
     */
28
    private $y;
29
30
    /**
31
     * @var Length
32
     */
33
    private $z;
34
35 11
    public function __construct(Length $x, Length $y, Length $z)
36
    {
37 11
        $this->x = $x;
38 11
        $this->y = $y;
39 11
        $this->z = $z;
40 11
    }
41
42 11
    public function getX(): Metre
43
    {
44 11
        return $this->x->asMetres();
45
    }
46
47 11
    public function getY(): Metre
48
    {
49 11
        return $this->y->asMetres();
50
    }
51
52 11
    public function getZ(): Metre
53
    {
54 11
        return $this->z->asMetres();
55
    }
56
}
57