@@ -47,7 +47,7 @@ class ResultSet implements Arrayable, ArrayAccess, Countable, IteratorAggregate,
4747 protected $ resource ;
4848
4949 public function __construct ($ builder , $ response , $ resource , $ all =false )
50- {
50+ {
5151 $ this ->all = $ all ;
5252 $ this ->builder = $ builder ;
5353 $ this ->resource = $ resource ;
@@ -73,15 +73,15 @@ protected function setRawStatus(bool $status=false)
7373 $ this ->raw = $ status ;
7474 }
7575
76- protected function processResponse ($ response )
76+ protected function processResponse ($ response )
7777 {
7878 $ this ->addResponse ($ response );
7979 $ this ->populate ($ response ->json ());
8080 $ this ->processMeta ($ response ->json ());
8181 $ this ->incrementQueries ();
8282 }
8383
84- protected function incrementQueries ()
84+ protected function incrementQueries ()
8585 {
8686 $ this ->queries ++;
8787 }
@@ -94,22 +94,22 @@ protected function canQuery()
9494 return $ this ->maxQueries > $ this ->queries ;
9595 }
9696
97- protected function incrementTotalDownloads ($ i =1 )
97+ protected function incrementTotalDownloads ($ i =1 )
9898 {
9999 $ this ->downloaded += $ i ;
100100 }
101101
102- public function resetQueryCount ()
102+ public function resetQueryCount ()
103103 {
104104 $ this ->queries = 0 ;
105105 }
106106
107- protected function addResponse ($ response )
107+ protected function addResponse ($ response )
108108 {
109109 $ this ->responses [] = $ response ;
110110 }
111111
112- protected function populate ($ array )
112+ protected function populate ($ array )
113113 {
114114 if ($ this ->raw ){
115115 $ this ->items = array_merge ($ this ->items , $ array [$ this ->resource ->getApiMultipleDataField ()]);
@@ -123,7 +123,7 @@ protected function populate($array)
123123 }
124124 }
125125
126- protected function processMeta ($ array )
126+ protected function processMeta ($ array )
127127 {
128128 if (Arr::has ($ array , $ this ->resource ->client ->getResultsPageField ())){
129129 $ this ->apiCurrentPage = (int ) Arr::get ($ array , $ this ->resource ->client ->getResultsPageField ());
@@ -176,50 +176,50 @@ protected function apiPageHasBeenDownloaded($page)
176176 return in_array ($ page , $ this ->apiPagesDownloaded );
177177 }
178178
179- protected function apiHasMorePages ()
179+ protected function apiHasMorePages ()
180180 {
181181 if ($ this ->apiLastPage () == null ){
182182 return true ;
183183 }
184184 return $ this ->apiLastPage () > $ this ->apiCurrentPage ();
185185 }
186186
187- protected function apiHasPerPage ()
187+ protected function apiHasPerPage ()
188188 {
189189 return $ this ->apiPerPage != '' ;
190190 }
191191
192- protected function apiIsFirstPage ()
192+ protected function apiIsFirstPage ()
193193 {
194194 return $ this ->apiCurrentPage () <= 1 ;
195195 }
196196
197- protected function apiLastPage ()
197+ protected function apiLastPage ()
198198 {
199199 return $ this ->apiLastPage ;
200200 }
201201
202- protected function apiFirstPage ()
202+ protected function apiFirstPage ()
203203 {
204204 return 1 ;
205205 }
206206
207- protected function apiPerPage ()
207+ protected function apiPerPage ()
208208 {
209209 return $ this ->apiPerPage ;
210210 }
211211
212- protected function apiCurrentPage ()
212+ protected function apiCurrentPage ()
213213 {
214214 return $ this ->apiCurrentPage ;
215215 }
216216
217- protected function apiNextPageNumber ()
217+ protected function apiNextPageNumber ()
218218 {
219219 return $ this ->apiCurrentPage + 1 ;
220220 }
221221
222- protected function apiPreviousPageNumber ()
222+ protected function apiPreviousPageNumber ()
223223 {
224224 return $ this ->apiCurrentPage - 1 ;
225225 }
@@ -229,7 +229,7 @@ protected function apiTotalRecords()
229229 return $ this ->apiTotalRecords ;
230230 }
231231
232- public function hasMorePages ()
232+ public function hasMorePages ()
233233 {
234234 if ($ this ->hasOwnMeta ){
235235 return $ this ->lastPage () > $ this ->currentPage ();
@@ -238,7 +238,7 @@ public function hasMorePages()
238238 }
239239 }
240240
241- public function hasPerPage ()
241+ public function hasPerPage ()
242242 {
243243 if ($ this ->hasOwnMeta ){
244244 return true ;
@@ -247,7 +247,7 @@ public function hasPerPage()
247247 }
248248 }
249249
250- public function isFirstPage ()
250+ public function isFirstPage ()
251251 {
252252 if ($ this ->hasOwnMeta ){
253253 return $ this ->currentPage () <= 1 ;
@@ -256,7 +256,7 @@ public function isFirstPage()
256256 }
257257 }
258258
259- public function totalRecords ()
259+ public function totalRecords ()
260260 {
261261 if ($ this ->totalRecords ){
262262 return $ this ->totalRecords ;
@@ -265,7 +265,7 @@ public function totalRecords()
265265 }
266266 }
267267
268- public function lastPage ()
268+ public function lastPage ()
269269 {
270270 if ($ this ->hasOwnMeta ){
271271 return $ this ->lastPage ;
@@ -274,7 +274,7 @@ public function lastPage()
274274 }
275275 }
276276
277- public function firstPage ()
277+ public function firstPage ()
278278 {
279279 if ($ this ->hasOwnMeta ){
280280 return 1 ;
@@ -283,7 +283,7 @@ public function firstPage()
283283 }
284284 }
285285
286- public function perPage ()
286+ public function perPage ()
287287 {
288288 if ($ this ->hasOwnMeta ){
289289 return $ this ->perPage ;
@@ -292,7 +292,7 @@ public function perPage()
292292 }
293293 }
294294
295- public function currentPage ()
295+ public function currentPage ()
296296 {
297297 if ($ this ->hasOwnMeta ){
298298 return $ this ->currentPage ;
@@ -301,7 +301,7 @@ public function currentPage()
301301 }
302302 }
303303
304- public function nextPageNumber ()
304+ public function nextPageNumber ()
305305 {
306306 if ($ this ->hasOwnMeta ){
307307 return $ this ->currentPage + 1 ;
@@ -310,7 +310,7 @@ public function nextPageNumber()
310310 }
311311 }
312312
313- public function previousPageNumber ()
313+ public function previousPageNumber ()
314314 {
315315 if ($ this ->hasOwnMeta ){
316316 return $ this ->currentPage -1 ;
@@ -319,7 +319,7 @@ public function previousPageNumber()
319319 }
320320 }
321321
322- public function processRecordSweep ()
322+ public function processRecordSweep ()
323323 {
324324 if ($ this ->all || !$ this ->builder ->shouldPaginate ()){
325325 $ this ->recursiveRecordCollection ();
@@ -342,7 +342,7 @@ public function recursiveRecordCollection()
342342 }
343343 }
344344
345- public function updateMeta ()
345+ public function updateMeta ()
346346 {
347347 $ this ->hasOwnMeta = true ;
348348 $ this ->perPage = $ this ->maxQueries * $ this ->apiPerPage ;
@@ -363,7 +363,7 @@ public function getNextRecords()
363363 return $ this ;
364364 }
365365
366- public function resetPage ()
366+ public function resetPage ()
367367 {
368368 $ this ->items = new Collection ;
369369 }
@@ -395,7 +395,7 @@ public function previousPage()
395395 } else {
396396 throw new OutOfResultSetException ();
397397 }
398-
398+
399399 return $ this ;
400400 }
401401
@@ -419,7 +419,7 @@ public function getCollection()
419419 return $ this ->items ;
420420 }
421421
422- public function getResults ()
422+ public function getResults ()
423423 {
424424 return $ this ->getCollection ();
425425 }
@@ -461,7 +461,7 @@ public function toArray()
461461 ];
462462 }
463463
464- public function itemsToArray ()
464+ public function itemsToArray ()
465465 {
466466 $ data = [];
467467 foreach ($ this ->items as $ item ){
@@ -485,4 +485,4 @@ public function __call($method, $parameters)
485485 return $ this ->forwardCallTo ($ this ->getCollection (), $ method , $ parameters );
486486 }
487487
488- }
488+ }
0 commit comments