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

GeometryCollection::addGeometryObject()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 2
c 0
b 0
f 0
dl 0
loc 5
ccs 3
cts 3
cp 1
rs 10
cc 1
nc 1
nop 1
crap 1
1
<?php
2
declare(strict_types=1);
3
4
namespace PrinsFrank\PhpGeoSVG\Geometry;
5
6
use PrinsFrank\PhpGeoSVG\Geometry\GeometryObject\GeometryObject;
7
8
class GeometryCollection
9
{
10
    /** @var GeometryObject[] */
11
    protected array $geometryObjects = [];
12
13 1
    public function addGeometryObject(GeometryObject $geometryObject): self
14
    {
15 1
        $this->geometryObjects[] = $geometryObject;
16
17 1
        return $this;
18
    }
19
20
    /**
21
     * @return GeometryObject[]
22
     */
23 1
    public function getGeometryObjects(): array
24
    {
25 1
        return $this->geometryObjects;
26
    }
27
}
28