Skip to content
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

Php 8.1 deprecation warning #736

Closed
olischmidt123 opened this issue Jan 12, 2022 · 4 comments · Fixed by #810
Closed

Php 8.1 deprecation warning #736

olischmidt123 opened this issue Jan 12, 2022 · 4 comments · Fixed by #810
Labels

Comments

@olischmidt123
Copy link

Describe the bug
When updating to php 8.1 i noticed some deprecation warning.

Deprecated: Return type of Predis\Client::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in vendor/predis/predis/src/Client.php on line 518

To Reproduce
install predis with on php 8.1 environment. Create Client instance.

Expected behavior
No deprecation warning.

Versions (please complete the following information):

  • Predis: 1.1
  • PHP 8.1
  • Redis Server 6.0.0
  • OS Ubuntu 20.10
@tillkruss
Copy link
Member

Update your package.

@trickeyone
Copy link
Contributor

@tillkruss This issue is still present in v2.0.3. I'm currently receiving the below deprecation warning:

Method "IteratorAggregate::getIterator()" might add "\Traversable" as a native return type declaration in the future. Do the same in implementation "Predis\Client" now to avoid errors or add an explicit @return annotation to suppress this message.

I'm currently on v2.0.3, and PHP 8.1

$ composer show predis/predis
name     : predis/predis
descrip. : A flexible and feature-complete Redis client for PHP.
keywords : nosql, predis, redis
versions : * v2.0.3
type     : library
license  : MIT License (MIT) (OSI approved) https://spdx.org/licenses/MIT.html#licenseText
homepage : http://github.com/predis/predis
source   : [git] https://github.com/predis/predis.git ff59f745815150c65ed388f7d64e7660fe961771
dist     : [zip] https://api.github.com/repos/predis/predis/zipball/ff59f745815150c65ed388f7d64e7660fe961771 ff59f745815150c65ed388f7d64e7660fe961771
path     : /Users/jengland/htdocs/sites/perform_app/app/vendor/predis/predis
names    : predis/predis

@tillkruss
Copy link
Member

@trickeyone Can you open a PR with the fix?

@trickeyone
Copy link
Contributor

@tillkruss PR created: #810

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging a pull request may close this issue.

3 participants