chore: clean up types and PHP 8-ify the code

This commit is contained in:
Ben Ramsey
2022-09-15 22:14:04 -05:00
parent ef842484ba
commit ae247f1dcd
39 changed files with 225 additions and 608 deletions
+6 -13
View File
@@ -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);
}
/**