Passed
Branch main (a3ac80)
by Frank
02:08
created

Polygon::getExteriorRing()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
cc 1
nc 1
nop 0
crap 1
1
<?php
2
declare(strict_types=1);
3
4
namespace PrinsFrank\PhpGeoSVG\Geometry\GeometryObject;
5
6
class Polygon extends GeometryObject
7
{
8
    /** @var LineString[] elements representing interior rings (or holes) */
9
    protected array $interiorRings = [];
10
11 1
    public function __construct(protected LineString $exteriorRing)
12
    {
13 1
    }
14
15 1
    public function addInteriorRing(LineString $lineString): self
16
    {
17 1
        $this->interiorRings[] = $lineString;
18
19 1
        return $this;
20
    }
21
22 1
    public function getExteriorRing(): LineString
23
    {
24 1
        return $this->exteriorRing;
25
    }
26
27
    /**
28
     * @return LineString[]
29
     */
30 1
    public function getInteriorRings(): array
31
    {
32 1
        return $this->interiorRings;
33
    }
34
}
35