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

Projected::getEpsgCode()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 0
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
13
class Projected extends CoordinateReferenceSystem
14
{
15
    public function __construct(
16
        int $epsgCode,
17
        CoordinateSystem $coordinateSystem,
18
        CoordinateReferenceSystem $baseCRS
19
    ) {
20
        $this->epsgCode = $epsgCode;
21
        $this->coordinateSystem = $coordinateSystem;
22
        $this->baseCRS = $baseCRS;
23
        $this->datum = $baseCRS->getDatum();
24
25
        assert(count($coordinateSystem->getAxes()) === 2);
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 getBaseCRS(): CoordinateReferenceSystem
39
    {
40
        return $this->baseCRS;
41
    }
42
}
43