Skip to content

Commit

Permalink
Support PHP 5.6
Browse files Browse the repository at this point in the history
  • Loading branch information
kamshory committed Oct 27, 2024
1 parent 9e0101c commit a400abb
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/Geometry/Map.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/Geometry/NodeAttribute.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
12 changes: 6 additions & 6 deletions src/Geometry/Polygon.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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;
Expand All @@ -52,7 +52,7 @@ public function addPoint(Point $point): self
*
* @return self
*/
public function clearPolygon(): self
public function clearPolygon()
{
$this->points = [];
return $this;
Expand All @@ -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) {
Expand All @@ -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) {
Expand All @@ -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;
}
Expand Down

0 comments on commit a400abb

Please sign in to comment.