Ejemplo n.º 1
0
 /**
  * Set genre
  *
  * @param string $genre
  *
  * @throws \BadMethodCallException
  * @return $this
  */
 public function setGenre($genre)
 {
     if (!is_array($this->availableGenres)) {
         $this->availableGenres = array_values(GetId3::getId3v1Genres());
     }
     if (in_array($genre, $this->availableGenres)) {
         $this->genre = $genre;
         return $this;
     }
     throw new \BadMethodCallException(sprintf('The genre "%s" is not available', $genre));
 }