/** * {@inheritdoc} */ public function getPoser($id) { if (!($json = json_decode($this->parser->get('plugin/updates?pluginId=' . $id . '&start=0&size=1'), true))) { return $this->createBadge('n/a'); } if (!isset($json['updates'][0]['updateVersion'])) { return $this->createBadge('n/a'); } return $this->createBadge($json['updates'][0]['updateVersion']); }
/** * {@inheritdoc} */ public function getPoser($id) { $content = explode("\n", $this->parser->get('downloadStatistic/csv?pluginId=' . $id . '&updateId=&period=month')); return new PoserBadge('downloads', sprintf('%s last month', $this->formatDownloads($content)), '097ABB'); }