From 6bf61dfa6b585db01b607a79bd64ec9c583a9c10 Mon Sep 17 00:00:00 2001 From: Mario Date: Thu, 14 Mar 2024 09:35:09 +0000 Subject: 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 --- vendor/ramsey/collection/src/AbstractArray.php | 60 +++++--------------------- 1 file changed, 11 insertions(+), 49 deletions(-) (limited to 'vendor/ramsey/collection/src/AbstractArray.php') diff --git a/vendor/ramsey/collection/src/AbstractArray.php b/vendor/ramsey/collection/src/AbstractArray.php index d72dbe697..5ce622aa7 100644 --- a/vendor/ramsey/collection/src/AbstractArray.php +++ b/vendor/ramsey/collection/src/AbstractArray.php @@ -17,8 +17,7 @@ namespace Ramsey\Collection; use ArrayIterator; use Traversable; -use function serialize; -use function unserialize; +use function count; /** * This class provides a basic implementation of `ArrayInterface`, to minimize @@ -34,7 +33,7 @@ abstract class AbstractArray implements ArrayInterface * * @var array */ - protected $data = []; + protected array $data = []; /** * Constructs a new array object. @@ -69,7 +68,7 @@ abstract class AbstractArray implements ArrayInterface * * @param array-key $offset The offset to check. */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->data[$offset]); } @@ -81,15 +80,12 @@ abstract class AbstractArray implements ArrayInterface * * @param array-key $offset The offset for which a value should be returned. * - * @return T|null the value stored at the offset, or null if the offset + * @return T the value stored at the offset, or null if the offset * does not exist. - * - * @psalm-suppress InvalidAttribute */ - #[\ReturnTypeWillChange] // phpcs:ignore - public function offsetGet($offset) + public function offsetGet(mixed $offset): mixed { - return $this->data[$offset] ?? null; + return $this->data[$offset]; } /** @@ -97,12 +93,11 @@ abstract class AbstractArray implements ArrayInterface * * @link http://php.net/manual/en/arrayaccess.offsetset.php ArrayAccess::offsetSet() * - * @param array-key|null $offset The offset to set. If `null`, the value may be - * set at a numerically-indexed offset. + * @param array-key | null $offset The offset to set. If `null`, the value + * may be set at a numerically-indexed offset. * @param T $value The value to set at the given offset. */ - // phpcs:ignore SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint - public function offsetSet($offset, $value): void + public function offsetSet(mixed $offset, mixed $value): void { if ($offset === null) { $this->data[] = $value; @@ -118,25 +113,11 @@ abstract class AbstractArray implements ArrayInterface * * @param array-key $offset The offset to remove from the array. */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->data[$offset]); } - /** - * Returns a serialized string representation of this array object. - * - * @deprecated The Serializable interface will go away in PHP 9. - * - * @link http://php.net/manual/en/serializable.serialize.php Serializable::serialize() - * - * @return string a PHP serialized string. - */ - public function serialize(): string - { - return serialize($this->data); - } - /** * Returns data suitable for PHP serialization. * @@ -150,25 +131,6 @@ abstract class AbstractArray implements ArrayInterface return $this->data; } - /** - * Converts a serialized string representation into an instance object. - * - * @deprecated The Serializable interface will go away in PHP 9. - * - * @link http://php.net/manual/en/serializable.unserialize.php Serializable::unserialize() - * - * @param string $serialized A PHP serialized string to unserialize. - * - * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint - */ - public function unserialize($serialized): void - { - /** @var array $data */ - $data = unserialize($serialized, ['allowed_classes' => false]); - - $this->data = $data; - } - /** * Adds unserialized data to the object. * @@ -204,6 +166,6 @@ abstract class AbstractArray implements ArrayInterface public function isEmpty(): bool { - return count($this->data) === 0; + return $this->data === []; } } -- cgit v1.2.3