From a400abb6c1f929f0a71ba616a8246619d06c3dae Mon Sep 17 00:00:00 2001 From: "Kamshory, MT" Date: Mon, 28 Oct 2024 06:36:11 +0700 Subject: [PATCH] Support PHP 5.6 --- src/Geometry/Map.php | 4 ++-- src/Geometry/NodeAttribute.php | 2 +- src/Geometry/Polygon.php | 12 ++++++------ 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/Geometry/Map.php b/src/Geometry/Map.php index 664e26c..f74fef9 100644 --- a/src/Geometry/Map.php +++ b/src/Geometry/Map.php @@ -26,7 +26,7 @@ class Map * * @param Area[]|null $areas An array of Area objects to initialize the map with. */ - public function __construct(array $areas = null) + public function __construct($areas = null) { if (isset($areas) && is_array($areas)) { $this->areas = $areas; @@ -41,7 +41,7 @@ public function __construct(array $areas = null) * @param Area $area Area to add * @return self */ - public function addArea(Area $area) + public function addArea($area) { $this->areas[] = $area; return $this; diff --git a/src/Geometry/NodeAttribute.php b/src/Geometry/NodeAttribute.php index 5229dc8..485ebb3 100644 --- a/src/Geometry/NodeAttribute.php +++ b/src/Geometry/NodeAttribute.php @@ -27,7 +27,7 @@ class NodeAttribute * * @param string[] $values An array of attribute values. */ - public function __construct(array $values) + public function __construct($values) { $this->values = $values; } diff --git a/src/Geometry/Polygon.php b/src/Geometry/Polygon.php index 9064dcb..dc12ea2 100644 --- a/src/Geometry/Polygon.php +++ b/src/Geometry/Polygon.php @@ -28,7 +28,7 @@ class Polygon * * @param Point[] $points Initial points for the polygon. */ - public function __construct(array $points = []) + public function __construct($points = []) { $this->points = $points; } @@ -39,7 +39,7 @@ public function __construct(array $points = []) * @param Point $point Point to add. * @return self */ - public function addPoint(Point $point): self + public function addPoint($point) { $this->points[] = $point; return $this; @@ -52,7 +52,7 @@ public function addPoint(Point $point): self * * @return self */ - public function clearPolygon(): self + public function clearPolygon() { $this->points = []; return $this; @@ -64,7 +64,7 @@ public function clearPolygon(): self * @return float The area of the polygon. * @throws InvalidPolygonException If the polygon has fewer than 3 points. */ - public function getArea(): float + public function getArea() { $cnt = count($this->points); if ($cnt < 3) { @@ -89,7 +89,7 @@ public function getArea(): float * @return float The circumference of the polygon. * @throws InvalidPolygonException If the polygon has fewer than 2 points. */ - public function getCircumference(): float + public function getCircumference() { $cnt = count($this->points); if ($cnt < 2) { @@ -112,7 +112,7 @@ public function getCircumference(): float * * @return Point[] An array of Point objects that define the polygon. */ - public function getPoints(): array + public function getPoints() { return $this->points; }