1<?php
2
3namespace geoPHP\Geometry;
4
5/**
6 * Class MultiCurve
7 * TODO write this
8 *
9 * @package geoPHP\Geometry
10 */
11abstract class MultiCurve extends MultiGeometry
12{
13
14    public function __construct($components = [], $allowEmptyComponents = true, $allowedComponentType = Curve::class)
15    {
16        parent::__construct($components, $allowEmptyComponents, $allowedComponentType);
17    }
18
19    public function geometryType()
20    {
21        return Geometry::MULTI_CURVE;
22    }
23
24    public function dimension()
25    {
26        return 1;
27    }
28
29    /**
30     * MultiCurve is closed if all it's components are closed
31     *
32     * @return bool
33     */
34    public function isClosed()
35    {
36        foreach ($this->getComponents() as $line) {
37            if (!$line->isClosed()) {
38                return false;
39            }
40        }
41        return true;
42    }
43}
44