diff options
author | Mario <mario@mariovavti.com> | 2022-10-11 18:34:03 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2022-10-11 18:34:03 +0000 |
commit | 108a3efe0b6d37a7ed394a84c69b924ca727f17a (patch) | |
tree | ed9904767622d769fcee883d407310087ed7d57a /vendor/ramsey/uuid/src/Type/Integer.php | |
parent | ccd826f63a7a4c7e442fab8a70d9c4c84808b417 (diff) | |
download | volse-hubzilla-108a3efe0b6d37a7ed394a84c69b924ca727f17a.tar.gz volse-hubzilla-108a3efe0b6d37a7ed394a84c69b924ca727f17a.tar.bz2 volse-hubzilla-108a3efe0b6d37a7ed394a84c69b924ca727f17a.zip |
update composer libs
Diffstat (limited to 'vendor/ramsey/uuid/src/Type/Integer.php')
-rw-r--r-- | vendor/ramsey/uuid/src/Type/Integer.php | 25 |
1 files changed, 9 insertions, 16 deletions
diff --git a/vendor/ramsey/uuid/src/Type/Integer.php b/vendor/ramsey/uuid/src/Type/Integer.php index 7690f6cd8..e41b3cad5 100644 --- a/vendor/ramsey/uuid/src/Type/Integer.php +++ b/vendor/ramsey/uuid/src/Type/Integer.php @@ -20,7 +20,7 @@ use ValueError; use function ctype_digit; use function ltrim; use function sprintf; -use function strpos; +use function str_starts_with; use function substr; /** @@ -40,23 +40,17 @@ final class Integer implements NumberInterface /** * @psalm-var numeric-string */ - private $value; + private string $value; - /** - * @var bool - */ - private $isNegative = false; + private bool $isNegative = false; - /** - * @param mixed $value The integer value to store - */ - public function __construct($value) + public function __construct(float | int | string | self $value) { $value = (string) $value; $sign = '+'; // If the value contains a sign, remove it for ctype_digit() check. - if (strpos($value, '-') === 0 || strpos($value, '+') === 0) { + if (str_starts_with($value, '-') || str_starts_with($value, '+')) { $sign = substr($value, 0, 1); $value = substr($value, 1); } @@ -127,18 +121,17 @@ final class Integer implements NumberInterface /** * Constructs the object from a serialized string representation * - * @param string $serialized The serialized string representation of the object + * @param string $data The serialized string representation of the object * - * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint * @psalm-suppress UnusedMethodCall */ - public function unserialize($serialized): void + public function unserialize(string $data): void { - $this->__construct($serialized); + $this->__construct($data); } /** - * @param array{string: string} $data + * @param array{string?: string} $data */ public function __unserialize(array $data): void { |