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

Simplify getting URI #1

Open
atymic opened this issue Jul 22, 2019 · 0 comments
Open

Simplify getting URI #1

atymic opened this issue Jul 22, 2019 · 0 comments

Comments

@atymic
Copy link

atymic commented Jul 22, 2019

Hey :)

First of all, thanks for the library, was going to write one very similar but found yours!.

Just a quick suggestion, currently i'm doing something like this in the code:

$url = $links->getRel('next') ? $links->getRel('next')->getUri() : null;

It's a bit tedious having to write a condition every time, as calling $links->getRel('next')->getUri() when there is no next link getRel returns null and causes an error.

Maybe we could add another method, such as: links->getRelUri('next') to try to fetch the url directly?

Let me know and I can create a PR.
I also noticed a couple of improvements that could be made, so can create a PR for those as well if you want :)

@atymic atymic changed the title Simply getting URI Simplify getting URI Jul 22, 2019
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

No branches or pull requests

1 participant