/** * @return Post * * @SuppressWarnings(PHPMD.StaticAccess) */ private function getRandomPost() { if ($this->posts === null) { $this->posts = Post::all(); } return $this->posts->random(); }