MDL-77097 store_mongodb: keep compatibility with PHP 7.4

Replaced 4 occurrences of get_debug_type() by gettype() to keep PHP 7.4 compatibility. Note this
has not been applied to 4.2dev and up because, there, it's safe to use get_debug_type().
This commit is contained in:
Eloy Lafuente (stronk7)
2023-02-24 12:38:47 +01:00
parent a31f5830bd
commit 7aeb3a8b6e
3 changed files with 8 additions and 4 deletions
@@ -21,7 +21,7 @@ use MongoDB\Driver\Exception\InvalidArgumentException as DriverInvalidArgumentEx
use function array_pop;
use function count;
use function get_debug_type;
use function gettype;
use function implode;
use function is_array;
use function sprintf;
@@ -57,6 +57,6 @@ class InvalidArgumentException extends DriverInvalidArgumentException implements
$expectedType = $typeString;
}
return new static(sprintf('Expected %s to have type "%s" but found "%s"', $name, $expectedType, get_debug_type($value)));
return new static(sprintf('Expected %s to have type "%s" but found "%s"', $name, $expectedType, gettype($value)));
}
}
@@ -17,7 +17,7 @@
namespace MongoDB\Exception;
use function get_debug_type;
use function gettype;
use function sprintf;
class ResumeTokenException extends RuntimeException
@@ -30,7 +30,7 @@ class ResumeTokenException extends RuntimeException
*/
public static function invalidType($value)
{
return new static(sprintf('Expected resume token to have type "array or object" but found "%s"', get_debug_type($value)));
return new static(sprintf('Expected resume token to have type "array or object" but found "%s"', gettype($value)));
}
/**
+4
View File
@@ -11,3 +11,7 @@ Import procedure:
value in the "are_requirements_met" method if necessary.
This version (1.15.0) requires PHP mongodb extension >= 1.14.0
Local changes:
- Replaced 4 occurrences of get_debug_type() by gettype() to keep PHP 7.4 compatibility. Note this
has not been applied to 4.2dev and up because, there, it's safe to use get_debug_type().