| Conditions | 3 |
| Paths | 4 |
| Total Lines | 12 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 38 | public function renderLatestBlogPosts() |
||
| 39 | { |
||
| 40 | $cacheId = $this->blogOptions->getCacheKey(); |
||
| 41 | $posts = $this->cache->contains($cacheId) ? $this->cache->fetch($cacheId) : []; |
||
| 42 | $elements = []; |
||
| 43 | |||
| 44 | foreach ($posts as $post) { |
||
| 45 | $elements[] = sprintf('<li><a target="_blank" href="%s">%s</a></li>', $post['link'], $post['title']); |
||
| 46 | } |
||
| 47 | |||
| 48 | return sprintf('<ul class="fh5co-links blog-posts">%s</ul>', implode('', $elements)); |
||
| 49 | } |
||
| 50 | } |
||
| 51 |