Passed
Push — 4.x ( c37faa...bd875a )
by Doug
12:53
created

Geographic3D   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 4
eloc 8
c 1
b 0
f 0
dl 0
loc 27
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getCoordinateSystem() 0 3 1
A getDatum() 0 3 1
A __construct() 0 10 1
A getEpsgCode() 0 3 1
1
<?php
2
/**
3
 * PHPCoord.
4
 *
5
 * @author Doug Wright
6
 */
7
declare(strict_types=1);
8
9
namespace PHPCoord\CoordinateReferenceSystem;
10
11
use PHPCoord\CoordinateSystem\CoordinateSystem;
12
use PHPCoord\Datum\Datum;
13
14
class Geographic3D extends CoordinateReferenceSystem
15
{
16
    public function __construct(
17
        int $epsgCode,
18
        CoordinateSystem $coordinateSystem,
19
        Datum $datum
20
    ) {
21
        $this->epsgCode = $epsgCode;
22
        $this->coordinateSystem = $coordinateSystem;
23
        $this->datum = $datum;
24
25
        assert(count($coordinateSystem->getAxes()) === 3);
26
    }
27
28
    public function getEpsgCode(): int
29
    {
30
        return $this->epsgCode;
31
    }
32
33
    public function getCoordinateSystem(): CoordinateSystem
34
    {
35
        return $this->coordinateSystem;
36
    }
37
38
    public function getDatum(): Datum
39
    {
40
        return $this->datum;
41
    }
42
}
43