-
Notifications
You must be signed in to change notification settings - Fork 385
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 support for PSR-18 HTTP clients #777
Add support for PSR-18 HTTP clients #777
Conversation
@@ -71,8 +73,17 @@ class Sniffer | |||
* | |||
* @param File $file Input file | |||
*/ | |||
public function __construct(File $file) | |||
public function __construct(/* File */ $file) |
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.
Removing the type hint is not a breaking change because we have not released 1.9.0 yet.
This PR is ready for review. Because this PR is build on #774 I recommend to merge this PR first. It will fix some BC breaks that comes with #774. To show only the changes between #774 and #777 you can look at the diff between the branches: Art4/simplepie@split-file-into-client-and-response...Art4:simplepie:add-psr18-http-client-support |
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.
Still need to resolve the question of non-absolute Location header and Redirect tracking.
$requestedUrl = $response->getHeaderLine('Location'); | ||
|
||
if ($statusCode === 301) { | ||
$permanentUrl = $requestedUrl; |
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.
thanks @Art4 this looks good, can we merge and handle the redirect case separately? |
@mblaney I resolved all conflicts and fixed all PHPStan errors. |
…ent-support" There are correctness issues as well as disorganized commit history. The fixed changes are re-applied in the commits that follow.
Hi all 👋
This is a follow up of #774 and will add support for every PSR-18 HTTP client implementation. 🥳
This PR will fixes #520. I propose this PR for SimplePie 1.9.0, see #731.