コード例 #1
0
ファイル: Writer.php プロジェクト: stdtabs/phptabs
 /**
  * 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();
 }
コード例 #2
0
ファイル: Dumper.php プロジェクト: stdtabs/phptabs
 /**
  * @param Tablature The tablature to dump
  */
 public function __construct(Tablature $tablature)
 {
     $this->song = $tablature->getSong();
 }