diff options
author | Mario <mario@mariovavti.com> | 2024-03-14 09:35:09 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2024-03-14 09:35:09 +0000 |
commit | 6bf61dfa6b585db01b607a79bd64ec9c583a9c10 (patch) | |
tree | 78698101aa58d918568dfc0020650fc337e8d3e0 /vendor/ramsey/collection/src/Tool/ValueToStringTrait.php | |
parent | 0e59cfb8390e4c6aee29ef73b53a4dc6b7fb581e (diff) | |
download | volse-hubzilla-6bf61dfa6b585db01b607a79bd64ec9c583a9c10.tar.gz volse-hubzilla-6bf61dfa6b585db01b607a79bd64ec9c583a9c10.tar.bz2 volse-hubzilla-6bf61dfa6b585db01b607a79bd64ec9c583a9c10.zip |
composer update and use the fixed streams php-jcs library until the floats issue will be fixed upstream. see here for reference https://codeberg.org/streams/streams/issues/151
Diffstat (limited to 'vendor/ramsey/collection/src/Tool/ValueToStringTrait.php')
-rw-r--r-- | vendor/ramsey/collection/src/Tool/ValueToStringTrait.php | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/vendor/ramsey/collection/src/Tool/ValueToStringTrait.php b/vendor/ramsey/collection/src/Tool/ValueToStringTrait.php index 721ade002..64fc5fa42 100644 --- a/vendor/ramsey/collection/src/Tool/ValueToStringTrait.php +++ b/vendor/ramsey/collection/src/Tool/ValueToStringTrait.php @@ -16,11 +16,12 @@ namespace Ramsey\Collection\Tool; use DateTimeInterface; -use function get_class; +use function assert; use function get_resource_type; use function is_array; use function is_bool; use function is_callable; +use function is_object; use function is_resource; use function is_scalar; @@ -44,7 +45,7 @@ trait ValueToStringTrait * * @param mixed $value the value to return as a string. */ - protected function toolValueToString($value): string + protected function toolValueToString(mixed $value): string { // null if ($value === null) { @@ -71,12 +72,8 @@ trait ValueToStringTrait return '(' . get_resource_type($value) . ' resource #' . (int) $value . ')'; } - // If we don't know what it is, use var_export(). - if (!is_object($value)) { - return '(' . var_export($value, true) . ')'; - } - // From here, $value should be an object. + assert(is_object($value)); // __toString() is implemented if (is_callable([$value, '__toString'])) { @@ -89,6 +86,6 @@ trait ValueToStringTrait } // unknown type - return '(' . get_class($value) . ' Object)'; + return '(' . $value::class . ' Object)'; } } |