| Conditions | 4 |
| Paths | 3 |
| Total Lines | 20 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 20 |
| Changes | 2 | ||
| Bugs | 1 | Features | 0 |
| 1 | <?php |
||
| 7 | public function get($args = array()) |
||
| 8 | { |
||
| 9 | $response = $this->call('get', $args); |
||
| 10 | |||
| 11 | $ingests = []; |
||
| 12 | |||
| 13 | if (is_object($response) === true) { |
||
| 14 | if (isset($response->ingests) === true) { |
||
| 15 | foreach($response->ingests as $ing) { |
||
| 16 | $ingest = new Twitch\Ingest; |
||
| 17 | $ingest->setName($ing->name); |
||
| 18 | $ingest->setAvailability($ing->availability); |
||
| 19 | $ingest->setDefault($ing->default); |
||
| 20 | $ingest->setUrlTemplate($ing->url_template); |
||
| 21 | $ingests[] = $ingest; |
||
| 22 | } |
||
| 23 | } |
||
| 24 | } |
||
| 25 | return $ingests; |
||
| 26 | } |
||
| 27 | } |