protected function points() { $points = array(); foreach ($this->points as $point) { $points[] = $point[0]; $points[] = $point[1]; } if (count($points) < 6) { throw new \Exception('Polygon needs at least 3 points.'); } return $points; }