Skip to content

Commit

Permalink
Use get_debug_type()
Browse files Browse the repository at this point in the history
  • Loading branch information
BenMorel committed Oct 9, 2022
1 parent f7f00e6 commit d17028d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Exception/UnexpectedGeometryException.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class UnexpectedGeometryException extends GeometryException
{
public static function unexpectedGeometryType(string $expectedClass, mixed $value) : UnexpectedGeometryException
{
$value = is_object($value) ? get_class($value) : gettype($value);
$value = get_debug_type($value);
$message = sprintf('Unexpected geometry type: expected %s, got %s.', $expectedClass, $value);

return new self($message);
Expand Down
4 changes: 2 additions & 2 deletions src/IO/GeoJSONReader.php
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ private function readFeatureCollection(stdClass $geoJsonFeatureCollection) : Fea
if (! is_object($feature)) {
throw GeometryIOException::invalidGeoJSON(sprintf(
'Unexpected data of type %s in "FeatureCollection.features" attribute.',
gettype($features)
get_debug_type($features)
));
}

Expand Down Expand Up @@ -260,7 +260,7 @@ private function readGeometryCollection(stdClass $jsonGeometryCollection): Geome
if (! is_object($geometry)) {
throw GeometryIOException::invalidGeoJSON(sprintf(
'Unexpected data of type %s in "GeometryCollection.geometries" attribute.',
gettype($geometry)
get_debug_type($geometry)
));
}

Expand Down

0 comments on commit d17028d

Please sign in to comment.