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

GeocentricValue::__construct()   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
eloc 3
c 1
b 0
f 0
dl 0
loc 5
ccs 4
cts 4
cp 1
rs 10
cc 1
nc 1
nop 3
crap 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