/** * {@inheritdoc} */ public function __construct(CoordinateSystem $cs, LineString ...$rings) { parent::__construct($cs, ...$rings); if ($this->isEmpty) { return; } if ($this->exteriorRing()->numPoints() !== 4) { throw new InvalidGeometryException('A triangle must have exactly 4 (3 + 1) points.'); } if ($this->numInteriorRings() !== 0) { throw new InvalidGeometryException('A triangle must not have interior rings.'); } }