Skip to content

Commit bf81101

Browse files
committed
removed debug
1 parent 3683986 commit bf81101

File tree

1 file changed

+19
-8
lines changed

1 file changed

+19
-8
lines changed

lib/Github/ResultPaginator.php

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,43 +14,54 @@ class ResultPaginator
1414

1515
protected $pagination = null;
1616

17-
public function __construct( Client $client ) {
17+
public function __construct( Client $client )
18+
{
1819
$this->client = $client;
1920
}
2021

21-
public function fetchAll( ApiInterface $api, $method, $parameters ) {
22+
public function fetchAll( ApiInterface $api, $method, $parameters )
23+
{
2224
$result = array();
23-
$result = call_user_func_array( array($api,$method), $parameters);
25+
$result = call_user_func_array(array($api, $method), $parameters);
26+
2427
$this->postFetch();
2528

2629
while ($this->hasNext()) {
2730
$result = array_merge($result, $this->fetchNext());
2831
}
32+
2933
return $result;
3034
}
3135

32-
protected function postFetch() {
36+
protected function postFetch()
37+
{
3338
$this->pagination = $this->client->getHttpClient()->getLastResponse()->getPagination();
34-
var_dump($this->pagination);
3539
}
3640

37-
public function fetchNext() {
41+
public function fetchNext()
42+
{
3843
$result = $this->client->getHttpClient()->get($this->pagination['next']);
44+
3945
$this->postFetch();
46+
4047
return $result->getContent();
4148
}
4249

43-
public function hasNext() {
50+
public function hasNext()
51+
{
4452
if (!empty($this->pagination) and isset($this->pagination['next'])) {
4553
return true;
4654
}
55+
4756
return false;
4857
}
4958

50-
public function hasPrevious() {
59+
public function hasPrevious()
60+
{
5161
if (!empty($this->pagination) and isset($this->pagination['previous'])) {
5262
return true;
5363
}
64+
5465
return false;
5566
}
5667

0 commit comments

Comments
 (0)