Code Duplication    Length = 11-11 lines in 2 locations

src/Charcoal/Cms/Service/Manager/EventManager.php 1 location

@@ 388-398 (lines=11) @@
385
     * Get the latest event.
386
     * @return EventInterface|array The latest event.
387
     */
388
    public function latest()
389
    {
390
        $entries = $this->entries();
391
392
        if (isset($entries[0])) {
393
            return $entries[0];
394
        } else {
395
            // NO EVENT!
396
            return [];
397
        }
398
    }
399
400
    /**
401
     * @return mixed The previous event

src/Charcoal/Cms/Service/Manager/NewsManager.php 1 location

@@ 291-301 (lines=11) @@
288
     * Get the latest news.
289
     * @return NewsInterface|array The latest news.
290
     */
291
    public function latest()
292
    {
293
        $entries = $this->entries();
294
295
        if (isset($entries[0])) {
296
            return $entries[0];
297
        } else {
298
            // NO NEWS!
299
            return [];
300
        }
301
    }
302
303
    /**
304
     * @return mixed The previous news