mirror of
https://github.com/ramsey/uuid.git
synced 2026-06-16 16:17:43 +03:00
chore: clean up types and PHP 8-ify the code
This commit is contained in:
+6
-13
@@ -40,17 +40,11 @@ final class Integer implements NumberInterface
|
||||
/**
|
||||
* @psalm-var numeric-string
|
||||
*/
|
||||
private $value;
|
||||
private string $value;
|
||||
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
private $isNegative = false;
|
||||
private bool $isNegative = false;
|
||||
|
||||
/**
|
||||
* @param int|float|string|self $value The integer value to store
|
||||
*/
|
||||
public function __construct($value)
|
||||
public function __construct(float | int | string | self $value)
|
||||
{
|
||||
$value = (string) $value;
|
||||
$sign = '+';
|
||||
@@ -127,14 +121,13 @@ 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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user