Conditions | 5 |
Paths | 3 |
Total Lines | 19 |
Lines | 0 |
Ratio | 0 % |
Tests | 9 |
CRAP Score | 5.025 |
Changes | 0 |
1 | <?php |
||
46 | 16 | public function fetchNext( $maxFetchCount ) { |
|
47 | 16 | if ( !is_int( $maxFetchCount ) || $maxFetchCount < 1 ) { |
|
48 | throw new \InvalidArgumentException( '$maxFetchCount needs to be int > 0' ); |
||
49 | } |
||
50 | |||
51 | do { |
||
52 | 16 | $idsInBatch = array_slice( $this->pagesToFetch, $this->position, $maxFetchCount ); |
|
53 | 16 | $this->position = min( $this->position + $maxFetchCount, count( $this->pagesToFetch ) ); |
|
54 | |||
55 | |||
56 | 16 | if ( empty( $idsInBatch ) ) { |
|
57 | 10 | return []; |
|
58 | } |
||
59 | |||
60 | 14 | $foundPages = $this->batchFetcher->fetchEntityPages( $idsInBatch ); |
|
61 | 14 | } while( $foundPages === [] ); |
|
62 | |||
63 | 13 | return $foundPages; |
|
64 | } |
||
65 | |||
74 |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..