/** * @param Release $release * @param bool $latest * * @return string */ private function renderRelease(Release $release, $latest = false) { $item = new \Text_Template(__DIR__ . '/../templates/item.html'); $manifest = ''; if (!empty($release->manifest())) { $manifest = sprintf(' class="phar" data-title="Manifest" data-content="<ul>%s</ul>" data-placement="bottom" data-html="true"', implode('', array_map(function ($item) { return '<li>' . $item . '</li>'; }, $release->manifest()))); } $item->setVar(['domain' => $this->domain(), 'package' => $release->package(), 'version' => $release->version(), 'date' => $release->date(), 'size' => $release->size(), 'sha256' => $release->sha256(), 'strongOpen' => $latest ? '<strong>' : '', 'strongClose' => $latest ? '</strong>' : '', 'manifest' => $manifest]); return $item->render(); }