private function getRandomGif($dir) { $imageIndex = rand(0, count($this->gifs[$dir]) - 1); return $this->gifs[$dir][$imageIndex]; }