Skip to content

Simplify getting URI #1

@atymic

Description

@atymic

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 :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions