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

Uncaught RuntimeException on Psl\Iter\Iterator::current() #288

Closed
pottink opened this issue Nov 26, 2021 · 10 comments
Closed

Uncaught RuntimeException on Psl\Iter\Iterator::current() #288

pottink opened this issue Nov 26, 2021 · 10 comments
Assignees
Labels
Priority: High After critical issues are fixed, these should be dealt with before any further issues. Status: Completed Nothing further to be done with this issue. Awaiting to be closed by the requestor out of politeness Type: Bug Inconsistencies or issues which will cause an issue or problem for users or implementors.

Comments

@pottink
Copy link

pottink commented Nov 26, 2021

Describe the bug
When running tests I get following error:

PHP Fatal error:  During inheritance of Iterator: Uncaught RuntimeException: PHP Error: Return type of Psl\Iter\Iterator::current() should either be compatible with Iterator::current(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/runner/work/http-tools/http-tools/vendor/azjezz/psl/src/Psl/Iter/Iterator.php:90 in phar:///home/runner/work/http-tools/http-tools/tools/psalm.phar/src/Psalm/Internal/ErrorHandler.php:53
Stack trace:
#0 /home/runner/work/http-tools/http-tools/vendor/azjezz/psl/src/Psl/Iter/Iterator.php(18): Psalm\Internal\ErrorHandler::Psalm\Internal\{closure}()
#1 /home/runner/work/http-tools/http-tools/vendor/azjezz/psl/src/Psl/Internal/Loader.php(683): require_once('...')
#2 /home/runner/work/http-tools/http-tools/vendor/azjezz/psl/src/Psl/Internal/Loader.php(690): Psl\Internal\Loader::load()
#3 [internal function]: Psl\Internal\Loader::Psl\Internal\{closure}()
#4 /home/runner/work/http-tools/http-tools/vendor/azjezz/psl/src/Psl/Internal/Loader.php(750): class_exists()
#5 /home/runner/work/http-tools/http-tools/vendor/azjezz/psl/src/Psl/Internal/Loader.php(675): Psl\Internal\Loader::loadClasses()
#6 /home/runner/work/http-tools/http-tools/vendor/azjezz/psl/src/Psl/Internal/Loader.php(699): Psl\Internal\Loader::Psl\Internal\{closure}()

To Reproduce
GitHub Actions:

Environment (please complete the following information):

  • OS: Ubuntu
  • PHP: 8.1
  • Version: 1.6.0
@pottink pottink added the Type: Bug Inconsistencies or issues which will cause an issue or problem for users or implementors. label Nov 26, 2021
@azjezz
Copy link
Owner

azjezz commented Nov 26, 2021

PSL 1.6.0 doesn't support PHP 8.1, i suggest you explicitly require PSL ^1.9.1

@azjezz azjezz closed this as completed Nov 26, 2021
@azjezz azjezz added Priority: High After critical issues are fixed, these should be dealt with before any further issues. Status: Completed Nothing further to be done with this issue. Awaiting to be closed by the requestor out of politeness labels Nov 26, 2021
@azjezz azjezz reopened this Nov 26, 2021
@azjezz
Copy link
Owner

azjezz commented Nov 26, 2021

Hmm, phppro/http-tools requires PHP 7.4, so you can't actually upgrade to PSL 1.9.1 yet, i think we can back port the PHP 8.1 fix to all branch from 1.6 to 1.8, and release a new version for each, this way you can set minimum required PSL version in your project to 1.6.1.

@veewee
Copy link
Collaborator

veewee commented Nov 26, 2021

No worries, we are planning to drop 7.4 support since they can still use older versions of the package with 7.4.
The issue why this was not clear, is because we are validating --prefer-lowest with --ignore-platform-reqs I suppose.

Thanks!

@azjezz
Copy link
Owner

azjezz commented Nov 26, 2021

is because we are validating --prefer-lowest with --ignore-platform-reqs I suppose.

not really, 1.6 allows php ^7.4 || ^8.0, meaning PHP 8.1 is fine, and 1.6 being the last version to support 7.4, i think it would be okay to back port PHP 8.1 fixes there ( using the attribute, since we can't use mixed return type there )

@azjezz
Copy link
Owner

azjezz commented Nov 26, 2021

ref: 9fdb771

@pottink
Copy link
Author

pottink commented Nov 26, 2021

Sorry, version is 1.9.2, typo.

@azjezz
Copy link
Owner

azjezz commented Nov 26, 2021

version is 1.9.2

no, i changed the version in your issue.

You are using --prefer-lowest in GitHub Action, which installs PSL 1.6.0.

@azjezz
Copy link
Owner

azjezz commented Nov 26, 2021

@veewee i'll leave this up to you, as i don't think i will have time to work on it personally in next couple of days ( i believe you have permission necessary to do so and release 1.6.2, 1.7.4, and 1.8.2 )

i personally think it's a good idea to fix compatibility with 8.1 for ^1.6.x since it's the last version with PHP 7.4 support, so people wanting to support PHP 7.4 and upwards can do so.

@veewee
Copy link
Collaborator

veewee commented Nov 26, 2021

Sounds like a solid plan! I am also very limited in time for a while. We'll see who gets to it first.

@azjezz
Copy link
Owner

azjezz commented Dec 8, 2021

fixed :)

released:

@azjezz azjezz closed this as completed Dec 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority: High After critical issues are fixed, these should be dealt with before any further issues. Status: Completed Nothing further to be done with this issue. Awaiting to be closed by the requestor out of politeness Type: Bug Inconsistencies or issues which will cause an issue or problem for users or implementors.
Projects
None yet
Development

No branches or pull requests

3 participants