| Conditions | 6 |
| Paths | 12 |
| Total Lines | 21 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 38 | public function __invoke(string $category, string $url) |
||
| 39 | { |
||
| 40 | $cat = $this->client->request('GET', $url); |
||
| 41 | |||
| 42 | $cat = json_decode($cat->getBody()->getContents(), true); |
||
| 43 | if (isset($cat['encoding']) && $cat['encoding'] === 'base64') { |
||
| 44 | $cat = json_decode(base64_decode($cat['content']), true); |
||
| 45 | } |
||
| 46 | foreach ($cat as $conference) { |
||
| 47 | if (! isset($conference['cfpEndDate'])) { |
||
| 48 | continue; |
||
| 49 | } |
||
| 50 | try { |
||
| 51 | $cfp = ($this->conferenceParser)($conference); |
||
| 52 | $cfp->addTag($category); |
||
| 53 | $this->writer->write($cfp, 'confs.tech'); |
||
| 54 | } catch (Exception $e) { |
||
| 55 | // Nothing to be done. We just skip over. |
||
| 56 | } |
||
| 57 | } |
||
| 58 | } |
||
| 59 | } |
||
| 60 |