{"action":"created","issue":{"url":"https://api.github.com/repos/KnpLabs/php-github-api/issues/306","labels_url":"https://api.github.com/repos/KnpLabs/php-github-api/issues/306/labels{/name}","comments_url":"https://api.github.com/repos/KnpLabs/php-github-api/issues/306/comments","events_url":"https://api.github.com/repos/KnpLabs/php-github-api/issues/306/events","html_url":"https://github.com/KnpLabs/php-github-api/issues/306","id":100617736,"number":306,"title":"milestones()->all results are in reverse order","user":{"login":"emersonthis","id":1728139,"avatar_url":"https://avatars.githubusercontent.com/u/1728139?v=3","gravatar_id":"","url":"https://api.github.com/users/emersonthis","html_url":"https://github.com/emersonthis","followers_url":"https://api.github.com/users/emersonthis/followers","following_url":"https://api.github.com/users/emersonthis/following{/other_user}","gists_url":"https://api.github.com/users/emersonthis/gists{/gist_id}","starred_url":"https://api.github.com/users/emersonthis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/emersonthis/subscriptions","organizations_url":"https://api.github.com/users/emersonthis/orgs","repos_url":"https://api.github.com/users/emersonthis/repos","events_url":"https://api.github.com/users/emersonthis/events{/privacy}","received_events_url":"https://api.github.com/users/emersonthis/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-08-12T19:34:01Z","updated_at":"2015-08-12T19:40:59Z","closed_at":null,"body":"This may be a case of old/incorrect GitHub API documentation, but according to [their docs](https://developer.github.com/v3/issues/milestones/#list-milestones-for-a-repository) the default for this...\r\n\r\n`$test = $this->client->api('issue')->milestones()->all($org, $repo);`\r\n\r\n...should be for results to be returned in ascending order by due_date. I get descending order.\r\n\r\nRegardless of the defaults, it would be convenient if this method accepted an additional (optional) config parameter to pass these settings."},"comment":{"url":"https://api.github.com/repos/KnpLabs/php-github-api/issues/comments/130423015","html_url":"https://github.com/KnpLabs/php-github-api/issues/306#issuecomment-130423015","issue_url":"https://api.github.com/repos/KnpLabs/php-github-api/issues/306","id":130423015,"user":{"login":"emersonthis","id":1728139,"avatar_url":"https://avatars.githubusercontent.com/u/1728139?v=3","gravatar_id":"","url":"https://api.github.com/users/emersonthis","html_url":"https://github.com/emersonthis","followers_url":"https://api.github.com/users/emersonthis/followers","following_url":"https://api.github.com/users/emersonthis/following{/other_user}","gists_url":"https://api.github.com/users/emersonthis/gists{/gist_id}","starred_url":"https://api.github.com/users/emersonthis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/emersonthis/subscriptions","organizations_url":"https://api.github.com/users/emersonthis/orgs","repos_url":"https://api.github.com/users/emersonthis/repos","events_url":"https://api.github.com/users/emersonthis/events{/privacy}","received_events_url":"https://api.github.com/users/emersonthis/received_events","type":"User","site_admin":false},"created_at":"2015-08-12T19:40:58Z","updated_at":"2015-08-12T19:40:58Z","body":"Just started to write a patch and saw that there's *already* a third param! Oops. \r\n\r\n```\r\n        if (isset($params['direction']) && !in_array($params['direction'], array('asc', 'desc'))) {\r\n            $params['direction'] = 'desc';\r\n        }\r\n```\r\n\r\nI 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. "}}