/** * Builds content in $format * * @param string $format * * @return string A binary chain * * @throws Exception if output format is not supported */ public function build($format) { if (!isset($this->writers[$format])) { $message = sprintf('Output format %s is not supported', $format); throw new Exception($message); } return (new $this->writers[$format]($this->tablature->getSong()))->getContent(); }
/** * @param Tablature The tablature to dump */ public function __construct(Tablature $tablature) { $this->song = $tablature->getSong(); }