-
-
Notifications
You must be signed in to change notification settings - Fork 598
Fix Pagination issue #55
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -55,6 +55,8 @@ class Client | |
'api_limit' => 5000, | ||
'api_version' => 'beta', | ||
|
||
'per_page' => 500, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why not 30? That is the default from github.. and the limit is 100... There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should be |
||
|
||
'cache_dir' => null | ||
); | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,6 +34,8 @@ class HttpClient implements HttpClientInterface | |
'api_limit' => 5000, | ||
'api_version' => 'beta', | ||
|
||
'per_page' => 500, | ||
|
||
'cache_dir' => null | ||
); | ||
/** | ||
|
@@ -119,10 +121,15 @@ public function addListener(ListenerInterface $listener) | |
*/ | ||
public function get($path, array $parameters = array(), array $headers = array()) | ||
{ | ||
if(is_int($this->options['per_page']) && $this->options['per_page'] > 0){ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should be different, this should go to |
||
$parameters['per_page'] = $this->options['per_page']; | ||
} | ||
|
||
if (0 < count($parameters)) { | ||
$path .= (false === strpos($path, '?') ? '?' : '&').http_build_query($parameters, '', '&'); | ||
} | ||
|
||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please revert this. |
||
return $this->request($path, array(), 'GET', $headers); | ||
} | ||
|
||
|
@@ -164,7 +171,6 @@ public function put($path, array $parameters = array(), array $headers = array() | |
public function request($path, array $parameters = array(), $httpMethod = 'GET', array $headers = array()) | ||
{ | ||
$path = trim($this->options['base_url'].$path, '/'); | ||
|
||
$request = $this->createRequest($httpMethod, $path); | ||
$request->addHeaders($headers); | ||
if (count($parameters) > 0) { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you should gitignore dev tool specific files and such in your system configuration ignore, not in a project ignore. and you can sefely ignore .idea/ instead of separate files.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please revert this.