php-travis-client icon indicating copy to clipboard operation
php-travis-client copied to clipboard

Add paging option when fetching builds

Open doublejosh opened this issue 11 years ago • 0 comments

Problem:

For example, when looking for builds by branch you can get no results when there are indeed builds beyond the "first page" of API results...

$client->fetchRepository($repo);
$client->getBuilds()->findBy(array('branch' => $branch));
$build = $builds->first();

Recommendations:

This would allow setting an optional page limit when populating repository data...

public function fetchRepository($slug, $pageLimit = 1)

This would make it a property of the client...

private $pageLimit = 1;
public function setPageLimit($limit)
{
  $this->pageLimit = $limit;
}

doublejosh avatar Jan 22 '15 21:01 doublejosh