-
-
Notifications
You must be signed in to change notification settings - Fork 993
Add PHP 8.1 support #712
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add PHP 8.1 support #712
Conversation
|
Thanks for submitting this. Can you please post the errors/deprecations you're seeing when running the current release in 8.1? |
| $options = array(); | ||
|
|
||
| if (strlen($this->match) > 0) { | ||
| if ($this->match !== null && strlen($this->match) > 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reason:
strlen(): Passing null to parameter #1 ($string) of type string is deprecated
| #[\ReturnTypeWillChange] | ||
| public function rewind() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reason for this and the following changes:
Fatal error: During inheritance of Iterator: Uncaught Return type of Predis\Collection\Iterator\ListKey::current() should either be compatible with Iterator::current(): mixed, or the #[ReturnTypeWillChange] attribute should be used to temporarily suppress the notice
Fatal error: During inheritance of Iterator: Uncaught Return type of Predis\Collection\Iterator\ListKey::next() should either be compatible with Iterator::next(): void, or the #[ReturnTypeWillChange] attribute should be used to temporarily suppress the notice
Fatal error: During inheritance of Iterator: Uncaught Return type of Predis\Collection\Iterator\ListKey::key() should either be compatible with Iterator::key(): mixed, or the #[ReturnTypeWillChange] attribute should be used to temporarily suppress the notice
Fatal error: During inheritance of Iterator: Uncaught Return type of Predis\Collection\Iterator\ListKey::valid() should either be compatible with Iterator::valid(): bool, or the #[ReturnTypeWillChange] attribute should be used to temporarily suppress the notice
Fatal error: During inheritance of Iterator: Uncaught Return type of Predis\Collection\Iterator\ListKey::rewind() should either be compatible with Iterator::rewind(): void, or the #[ReturnTypeWillChange] attribute should be used to temporarily suppress the notice
| #[\ReturnTypeWillChange] | ||
| public function offsetExists($index) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reason for this and the following changes:
Fatal error: During inheritance of ArrayAccess: Uncaught Return type of Predis\Command\Processor\ProcessorChain::offsetExists($index) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[ReturnTypeWillChange] attribute should be used to temporarily suppress the notice
Fatal error: During inheritance of ArrayAccess: Uncaught Return type of Predis\Command\Processor\ProcessorChain::offsetGet($index) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[ReturnTypeWillChange] attribute should be used to temporarily suppress the notice
Fatal error: During inheritance of ArrayAccess: Uncaught Return type of Predis\Command\Processor\ProcessorChain::offsetSet($index, $processor) should either be compatible with ArrayAccess::offsetSet(mixed $offset, mixed $value): void, or the #[ReturnTypeWillChange] attribute should be used to temporarily suppress the notice
Fatal error: During inheritance of ArrayAccess: Uncaught Return type of Predis\Command\Processor\ProcessorChain::offsetUnset($index) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[ReturnTypeWillChange] attribute should be used to temporarily suppress the notice
src/Command/ServerSentinel.php
Outdated
| switch (strtolower($this->getArgument(0))) { | ||
| $argument = $this->getArgument(0); | ||
|
|
||
| switch (strtolower($argument !== null ? $argument : '')) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reason:
strtolower(): Passing null to parameter #1 ($string) of type string is deprecated
src/CommunicationException.php
Outdated
| \Exception $innerException = null | ||
| ) { | ||
| parent::__construct($message, $code, $innerException); | ||
| parent::__construct($message !== null ? $message : '', $code !== null ? $code : 0, $innerException); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reason:
Exception::__construct(): Passing null to parameter #1 ($message) of type string is deprecated
Exception::__construct(): Passing null to parameter #2 ($code) of type int is deprecated
| #[\ReturnTypeWillChange] | ||
| public function rewind() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reason for this and the following changes:
Fatal error: During inheritance of Iterator: Uncaught Return type of Predis\PubSub\AbstractConsumer::current() should either be compatible with Iterator::current(): mixed, or the #[ReturnTypeWillChange] attribute should be used to temporarily suppress the notice
Fatal error: During inheritance of Iterator: Uncaught Return type of Predis\PubSub\AbstractConsumer::next() should either be compatible with Iterator::next(): void, or the #[ReturnTypeWillChange] attribute should be used to temporarily suppress the notice
Fatal error: During inheritance of Iterator: Uncaught Return type of Predis\PubSub\AbstractConsumer::key() should either be compatible with Iterator::key(): mixed, or the #[ReturnTypeWillChange] attribute should be used to temporarily suppress the notice
Fatal error: During inheritance of Iterator: Uncaught Return type of Predis\PubSub\AbstractConsumer::valid() should either be compatible with Iterator::valid(): bool, or the #[ReturnTypeWillChange] attribute should be used to temporarily suppress the notice
Fatal error: During inheritance of Iterator: Uncaught Return type of Predis\PubSub\AbstractConsumer::rewind() should either be compatible with Iterator::rewind(): void, or the #[ReturnTypeWillChange] attribute should be used to temporarily suppress the notice
| $sha1 = $eval ? sha1($command->getArgument(0)) : $command->getArgument(0); | ||
| $argument = $command->getArgument(0); | ||
| $sha1 = $eval ? sha1($argument !== null ? $argument : '') : $argument; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reason:
sha1(): Passing null to parameter #1 ($string) of type string is deprecated
| #[\ReturnTypeWillChange] | ||
| public function rewind() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reason for this and the following changes:
Fatal error: During inheritance of Iterator: Uncaught Return type of Predis\Response\Iterator\MultiBulkIterator::current() should either be compatible with Iterator::current(): mixed, or the #[ReturnTypeWillChange] attribute should be used to temporarily suppress the notice
Fatal error: During inheritance of Iterator: Uncaught Return type of Predis\Response\Iterator\MultiBulkIterator::next() should either be compatible with Iterator::next(): void, or the #[ReturnTypeWillChange] attribute should be used to temporarily suppress the notice
Fatal error: During inheritance of Iterator: Uncaught Return type of Predis\Response\Iterator\MultiBulkIterator::key() should either be compatible with Iterator::key(): mixed, or the #[ReturnTypeWillChange] attribute should be used to temporarily suppress the notice
Fatal error: During inheritance of Iterator: Uncaught Return type of Predis\Response\Iterator\MultiBulkIterator::valid() should either be compatible with Iterator::valid(): bool, or the #[ReturnTypeWillChange] attribute should be used to temporarily suppress the notice
Fatal error: During inheritance of Iterator: Uncaught Return type of Predis\Response\Iterator\MultiBulkIterator::rewind() should either be compatible with Iterator::rewind(): void, or the #[ReturnTypeWillChange] attribute should be used to temporarily suppress the notice
Fatal error: During inheritance of Countable: Uncaught Return type of Predis\Response\Iterator\MultiBulkIterator::count() should either be compatible with Countable::count(): int, or the #[ReturnTypeWillChange] attribute should be used to temporarily suppress the notice
| #[\ReturnTypeWillChange] | ||
| public function getInnerIterator() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reason:
Fatal error: During inheritance of OuterIterator: Uncaught Return type of Predis\Response\Iterator\MultiBulkTuple::getInnerIterator() should either be compatible with OuterIterator::getInnerIterator(): ?Iterator, or the #[ReturnTypeWillChange] attribute should be used to temporarily suppress the notice
| public function __construct(MultiExec $transaction, $message, $code = null) | ||
| { | ||
| parent::__construct($message, $code); | ||
| parent::__construct($message, $code !== null ? $code : 0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reason:
Exception::__construct(): Passing null to parameter #2 ($code) of type int is deprecated
No description provided.