/** * Constructor * * @param array $positions The Point array */ public function __construct(array $positions) { if (count($positions) > 1) { parent::__construct($positions); } else { throw new Exception("Linestring with less than two points"); } }
public function __construct($components) { $first = $components[0]; $last = end($components); if (!$first->equals($last)) { throw new InvalidFeature(__CLASS__, "LinearRing must be closed"); } parent::__construct($components); }
public function __construct($components = array()) { $this->componentTypes = "point"; parent::__construct($components); }