| Conditions | 2 |
| Paths | 2 |
| Total Lines | 13 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 6 |
| Changes | 0 | ||
| 1 | <?php |
||
| 23 | public function getAvailable() |
||
| 24 | { |
||
| 25 | $this->current = $this->pool->first(function (TwitApp $app) { |
||
| 26 | return $app->available(); |
||
| 27 | }); |
||
| 28 | |||
| 29 | if (! $this->current) { |
||
| 30 | // We will return the first one to get the rate limits so we can sleep |
||
| 31 | // and wait for reset |
||
| 32 | $this->current = $this->pool->get(0); |
||
| 33 | } |
||
| 34 | |||
| 35 | return $this->current; |
||
| 36 | } |
||
| 56 |