Skip to content

Throwable is available starting with 7.0 PHP version #142

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

Closed
kampalex opened this issue Jun 4, 2020 · 2 comments · Fixed by #144
Closed

Throwable is available starting with 7.0 PHP version #142

kampalex opened this issue Jun 4, 2020 · 2 comments · Fixed by #144
Labels
type: bug bug in the library

Comments

@kampalex
Copy link
Contributor

kampalex commented Jun 4, 2020

Issue Summary

According to composer.json, this library supports PHP version 5.6 and greater.

During review, my IDE warned that Throwable is used in file InvalidRequest. This interface is available since PHP 7.0.

Solution: bump PHP version requirement to '>=7.x' or replace Throwable using Exception.

Technical details:

  • php-http-client version: current master (according to composer.lock of other project: 3.10.6 / 2020-04-29T19:42:26+00:00)
  • php version: 7.1 (compatible version for configured phpunit)
@kampalex
Copy link
Contributor Author

kampalex commented Jun 7, 2020

Added context:
Luckily, the thrown InvalidRequest exception in makeRequest() does not have the $previous/3rd argument, so the null isn't compared against expected interface Throwable.
This is the reason build tests in PHP 5.6 are passing. But when set, it will lead to fatal error.

childish-sambino pushed a commit that referenced this issue Jun 9, 2020
Fixes #142

Throwable was not added until PHP 7 but we still support PHP 5.6 so this needed to be replaced.
@childish-sambino
Copy link
Contributor

Nice find. PR submitted.

@childish-sambino childish-sambino added status: work in progress Twilio or the community is in the process of implementing type: bug bug in the library labels Jun 9, 2020
childish-sambino pushed a commit that referenced this issue Jun 10, 2020
Fixes #142

Throwable was not added until PHP 7 but we still support PHP 5.6 so this needed to be replaced.
@childish-sambino childish-sambino removed the status: work in progress Twilio or the community is in the process of implementing label Jun 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug bug in the library
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants