Ejemplo n.º 1
0
 public function __construct(GithubHttpConnnector $connector, $converter = null, $url, array $params = array())
 {
     $this->connector = $connector;
     $this->converter = $converter;
     $this->url = $url;
     $this->params = $params;
     $entriesPerPage = array_key_exists('per_page', $params) ? $params['per_page'] : self::DEFAULT_ENTRIES_PER_PAGE;
     $self = $this;
     parent::__construct(new TakeWhileIterator(new MapIterator(new RangeIterator(1, INF), function ($pageNum) use($self, $entriesPerPage) {
         return $self->page($entriesPerPage, $pageNum);
     }), function ($response) {
         return is_array($response) && count($response) > 0;
     }), ChainIterator::DONT_USE_KEYS);
 }
Ejemplo n.º 2
0
 public function rewind()
 {
     $this->currentHash = null;
     parent::rewind();
 }