Skip to content

Conversation

Ndiritu
Copy link
Contributor

@Ndiritu Ndiritu commented Nov 7, 2023

Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Related tickets fixes #29
Documentation if this is a new feature, link to pull request in https://github.com/php-http/documentation that adds relevant documentation
License MIT

What's in this PR?

  • Corrects the PHPDoc for wait() to handle the possible void and null return values based on the method's description.
  • Uses the \Throwable interface instead of \Exception in onRejected callable parameter type
  • Adds PHPStan configs and workflow checks to catch future issues early.

Checklist

  • Updated CHANGELOG.md to describe BC breaks / deprecations | new feature | bugfix

To Do

  • Should we consider using conditional return types for wait() e.g. @return ($unwrap is true ? T : null|void). This would eliminate further PHPStan failures for dependent libs, however this syntax requires PHPStan ^1.6.0. Would this be a better approach? At the moment, using T|null|void could cause further PHPStan failures for dependent libs. Would these further failures be considered a BC break?
@dbu
Copy link
Contributor

dbu commented Nov 7, 2023

1.6 is from april 2022, so i think that seems reasonable to expect.

lets add that and avoid further confusion for consumers phpstan checks.

Copy link
Contributor

@dbu dbu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks a lot!

@dbu dbu merged commit 7fa2284 into php-http:1.x Nov 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants