Skip to content

milestones()->all results are in reverse order #306

Closed

Description

@emersonthis

This may be a case of old/incorrect GitHub API documentation, but according to their docs the default for this...

$test = $this->client->api('issue')->milestones()->all($org, $repo);

...should be for results to be returned in ascending order by due_date. I get descending order.

Regardless of the defaults, it would be convenient if this method accepted an additional (optional) config parameter to pass these settings.

Activity

  1. emersonthis commented on Aug 12, 2015

    @emersonthis
    ContributorAuthor

    Just started to write a patch and saw that there's already a third param! Oops.

            if (isset($params['direction']) && !in_array($params['direction'], array('asc', 'desc'))) {
                $params['direction'] = 'desc';
            }
    

    I think it's more intuitive for the default to match the API (asc), but since it's configurable we could just mention it in the docs. I'd be happy to submit a PR for either. Lemme know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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