/** * (non-PHPdoc) * @see lib/Geometry/Collection#addComponent($component, $index) */ public function addComponent($component, $index = null) { $added = false; $lastPoint = array_pop($this->components); if ($index != null || empty($lastPoint) || !$component->equals($lastpoint)) { $added = parent::addComponent($component, $index); } //TODO cas index != null à traiter //append copy of first point $firstPoint = $this->components[0]; parent::addComponent($firstPoint); return $added; }