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

Graby: Return object instead of an array #316

Merged
merged 5 commits into from
Mar 31, 2023
Merged

Conversation

jtojnar
Copy link
Collaborator

@jtojnar jtojnar commented Mar 30, 2023

No description provided.

*/
final class Content
{
private int $status;
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Maybe instead of HTTP properties, we could just store PSR-7 response object.

Copy link
Owner

@j0k3r j0k3r Mar 30, 2023

Choose a reason for hiding this comment

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

As far as I remember we've added the status to be able to retrieve it in wallabag (same as for headers).
So maybe we can ditch both and keep one response or httpResponse?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, though I would want to return that with Graby\Extractor\HttpClient::fetch(). And we would still need some mechanism to pass the effective URL. I guess we can decide on that later.

src/Content.php Outdated Show resolved Hide resolved
@jtojnar jtojnar marked this pull request as draft March 30, 2023 00:37
@jtojnar jtojnar marked this pull request as ready for review March 30, 2023 16:48
@jtojnar jtojnar force-pushed the content-object branch 3 times, most recently from 1384824 to cbe698a Compare March 30, 2023 17:47
src/Graby.php Outdated Show resolved Hide resolved
src/Graby.php Show resolved Hide resolved
src/Graby.php Outdated Show resolved Hide resolved
src/Content.php Show resolved Hide resolved
@j0k3r j0k3r added this to the 3.0.0 milestone Mar 30, 2023
@jtojnar jtojnar force-pushed the content-object branch 8 times, most recently from 61c1b13 to 23e2cfa Compare March 31, 2023 00:03
jtojnar added 5 commits March 31, 2023 02:19
Use `array<string>` instead of `array<string|false>|null`.
This will allow static analysis tools to work better and make Graby more usable in IDEs.
@jtojnar jtojnar mentioned this pull request Mar 31, 2023
Copy link
Owner

@j0k3r j0k3r left a comment

Choose a reason for hiding this comment

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

Good job!

@j0k3r j0k3r merged commit f4faf58 into j0k3r:master Mar 31, 2023
@jtojnar jtojnar deleted the content-object branch March 31, 2023 08:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants