Skip to content

Commit

Permalink
Require enums in interface signatures
Browse files Browse the repository at this point in the history
  • Loading branch information
jsor committed Jan 17, 2022
1 parent 43d909e commit f9a7e36
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 14 deletions.
8 changes: 2 additions & 6 deletions src/Extractor.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,13 @@ public function supports(mixed $geometry): bool;

/**
* Extracts the type of the given geometry.
*
* Must return one of the GeometryType::* constants.
*/
public function extractType(mixed $geometry): string;
public function extractType(mixed $geometry): GeometryType;

/**
* Extracts the dimension of the given geometry.
*
* Must return one of the Dimension::* constants.
*/
public function extractDimension(mixed $geometry): string;
public function extractDimension(mixed $geometry): Dimension;

/**
* Extracts the SRID of the given geometry.
Expand Down
16 changes: 8 additions & 8 deletions src/Factory.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ interface Factory
* If the Coordinates argument is `null`, it should create an empty point.
*/
public function createPoint(
string $dimension,
Dimension $dimension,
?int $srid,
?Coordinates $coordinates,
): mixed;
Expand All @@ -27,7 +27,7 @@ public function createPoint(
* LineString.
*/
public function createLineString(
string $dimension,
Dimension $dimension,
?int $srid,
iterable $points,
): mixed;
Expand All @@ -46,7 +46,7 @@ public function createLineString(
* LinearRing, it can return a LineString instead.
*/
public function createLinearRing(
string $dimension,
Dimension $dimension,
?int $srid,
iterable $points,
): mixed;
Expand All @@ -62,7 +62,7 @@ public function createLinearRing(
* Polygon.
*/
public function createPolygon(
string $dimension,
Dimension $dimension,
?int $srid,
iterable $linearRings,
): mixed;
Expand All @@ -78,7 +78,7 @@ public function createPolygon(
* MultiPoint.
*/
public function createMultiPoint(
string $dimension,
Dimension $dimension,
?int $srid,
iterable $points,
): mixed;
Expand All @@ -94,7 +94,7 @@ public function createMultiPoint(
* MultiLineString.
*/
public function createMultiLineString(
string $dimension,
Dimension $dimension,
?int $srid,
iterable $lineStrings,
): mixed;
Expand All @@ -110,7 +110,7 @@ public function createMultiLineString(
* MultiPolygon.
*/
public function createMultiPolygon(
string $dimension,
Dimension $dimension,
?int $srid,
iterable $polygons,
): mixed;
Expand All @@ -126,7 +126,7 @@ public function createMultiPolygon(
* GeometryCollection.
*/
public function createGeometryCollection(
string $dimension,
Dimension $dimension,
?int $srid,
iterable $geometries,
): mixed;
Expand Down

0 comments on commit f9a7e36

Please sign in to comment.