Skip to content

Commit

Permalink
Use get_debug_type() instead of manually determining the value type
Browse files Browse the repository at this point in the history
  • Loading branch information
jeromegamez authored and jmikola committed Apr 1, 2022
1 parent 5a69451 commit 9c1f020
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
],
"require": {
"php": "^7.4 || ^8.0",
"ext-json": "*"
"ext-json": "*",
"symfony/polyfill-php80": "^1.25"
},
"require-dev": {
"phpunit/phpunit": "^9.5",
Expand Down
3 changes: 2 additions & 1 deletion src/GeoJson/Exception/UnserializationException.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
use function is_object;
use function get_class;
use function gettype;
use function get_debug_type;

class UnserializationException extends RuntimeException implements Exception
{
Expand All @@ -24,7 +25,7 @@ public static function invalidValue(string $context, $value, string $expectedTyp
'%s expected value of type %s, %s given',
$context,
$expectedType,
is_object($value) ? get_class($value) : gettype($value)
get_debug_type($value)
));
}

Expand Down

0 comments on commit 9c1f020

Please sign in to comment.