diff options
author | Mario <mario@mariovavti.com> | 2022-10-11 18:41:34 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2022-10-11 18:41:34 +0000 |
commit | 10ba98c4f5ec4efe6272516de47f0ce128ef2902 (patch) | |
tree | fbbde69114acba764cf6b735433c53e099fd19c5 /vendor/ramsey/uuid/src/Type/Time.php | |
parent | 108a3efe0b6d37a7ed394a84c69b924ca727f17a (diff) | |
download | volse-hubzilla-10ba98c4f5ec4efe6272516de47f0ce128ef2902.tar.gz volse-hubzilla-10ba98c4f5ec4efe6272516de47f0ce128ef2902.tar.bz2 volse-hubzilla-10ba98c4f5ec4efe6272516de47f0ce128ef2902.zip |
Revert "update composer libs"
This reverts commit 108a3efe0b6d37a7ed394a84c69b924ca727f17a.
Diffstat (limited to 'vendor/ramsey/uuid/src/Type/Time.php')
-rw-r--r-- | vendor/ramsey/uuid/src/Type/Time.php | 37 |
1 files changed, 24 insertions, 13 deletions
diff --git a/vendor/ramsey/uuid/src/Type/Time.php b/vendor/ramsey/uuid/src/Type/Time.php index 745b5ccab..dd1b8bc28 100644 --- a/vendor/ramsey/uuid/src/Type/Time.php +++ b/vendor/ramsey/uuid/src/Type/Time.php @@ -17,6 +17,7 @@ namespace Ramsey\Uuid\Type; use Ramsey\Uuid\Exception\UnsupportedOperationException; use Ramsey\Uuid\Type\Integer as IntegerObject; use ValueError; +use stdClass; use function json_decode; use function json_encode; @@ -33,13 +34,22 @@ use function sprintf; */ final class Time implements TypeInterface { - private IntegerObject $seconds; - private IntegerObject $microseconds; + /** + * @var IntegerObject + */ + private $seconds; + + /** + * @var IntegerObject + */ + private $microseconds; - public function __construct( - float | int | string | IntegerObject $seconds, - float | int | string | IntegerObject $microseconds = 0, - ) { + /** + * @param mixed $seconds + * @param mixed $microseconds + */ + public function __construct($seconds, $microseconds = 0) + { $this->seconds = new IntegerObject($seconds); $this->microseconds = new IntegerObject($microseconds); } @@ -94,26 +104,27 @@ final class Time implements TypeInterface /** * Constructs the object from a serialized string representation * - * @param string $data The serialized string representation of the object + * @param string $serialized The serialized string representation of the object * + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint * @psalm-suppress UnusedMethodCall */ - public function unserialize(string $data): void + public function unserialize($serialized): void { - /** @var array{seconds?: int|float|string, microseconds?: int|float|string} $time */ - $time = json_decode($data, true); + /** @var stdClass $time */ + $time = json_decode($serialized); - if (!isset($time['seconds']) || !isset($time['microseconds'])) { + if (!isset($time->seconds) || !isset($time->microseconds)) { throw new UnsupportedOperationException( 'Attempted to unserialize an invalid value' ); } - $this->__construct($time['seconds'], $time['microseconds']); + $this->__construct($time->seconds, $time->microseconds); } /** - * @param array{seconds?: string, microseconds?: string} $data + * @param array{seconds: string, microseconds: string} $data */ public function __unserialize(array $data): void { |