start to add ability to merge tunes
started refactoring tune builders to use string type hint instead of StringAtom
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
namespace XaiCorp\AbcParser\Domain\Modules\Interpreter;
|
||||
|
||||
use Enzyme\Axiom\Atoms\StringAtom;
|
||||
use Webpatser\Uuid\Uuid;
|
||||
use XaiCorp\AbcParser\Domain\Atoms\EmailAtom;
|
||||
use XaiCorp\AbcParser\Domain\Atoms\UnsignedIntegerAtom;
|
||||
use XaiCorp\AbcParser\Domain\Core\Author;
|
||||
@@ -9,10 +10,11 @@ use XaiCorp\AbcParser\Domain\Core\Composer;
|
||||
use XaiCorp\AbcParser\Domain\Core\Setting;
|
||||
use XaiCorp\AbcParser\Domain\Core\Transcriber;
|
||||
use XaiCorp\AbcParser\Domain\Core\Tune;
|
||||
use XaiCorp\AbcParser\Domain\Core\TuneBuilder;
|
||||
use XaiCorp\AbcParser\Domain\Core\TuneCollection;
|
||||
use XaiCorp\AbcParser\Models\Laravel5\TuneSetting;
|
||||
//use XaiCorp\AbcParser\Models\Laravel5\TuneSetting;
|
||||
|
||||
class Builder
|
||||
class Builder implements TuneBuilder
|
||||
{
|
||||
/**
|
||||
* @var Tune
|
||||
@@ -50,7 +52,7 @@ class Builder
|
||||
$this->tune->addSetting($this->setting);
|
||||
}
|
||||
|
||||
public function getTune()
|
||||
public function getTune(Uuid $identity = null): \XaiCorp\AbcParser\Domain\Core\Tune
|
||||
{
|
||||
return $this->tune;
|
||||
}
|
||||
@@ -64,7 +66,7 @@ class Builder
|
||||
}
|
||||
|
||||
/**
|
||||
* @return $this
|
||||
* @return TuneBuilder
|
||||
*/
|
||||
public function handleEndOfMusic()
|
||||
{
|
||||
@@ -82,26 +84,26 @@ class Builder
|
||||
}
|
||||
|
||||
/**
|
||||
* @param UnsignedIntegerAtom $index
|
||||
* @return $this
|
||||
* @param UnsignedIntegerAtom $param
|
||||
* @return TuneBuilder
|
||||
*/
|
||||
public function setIndex(UnsignedIntegerAtom $index)
|
||||
public function setIndex(UnsignedIntegerAtom $param): \XaiCorp\AbcParser\Domain\Core\TuneBuilder
|
||||
{
|
||||
$this->tune->setIndex($index);
|
||||
$this->tune->setIndex($param);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function appendMusic(StringAtom $musicLine)
|
||||
public function appendMusic(StringAtom $param): \XaiCorp\AbcParser\Domain\Core\TuneBuilder
|
||||
{
|
||||
$this->setting->addMusicLine($musicLine->getValue());
|
||||
$this->setting->addMusicLine($param->getValue());
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function addTitle(StringAtom $title)
|
||||
public function addTitle(string $title): \XaiCorp\AbcParser\Domain\Core\TuneBuilder
|
||||
{
|
||||
$this->tune->addTitle($title->getValue());
|
||||
$this->tune->addTitle($title);
|
||||
|
||||
return $this;
|
||||
}
|
||||
@@ -120,9 +122,9 @@ class Builder
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function addAuthor(StringAtom $name)
|
||||
public function addAuthor(string $name): \XaiCorp\AbcParser\Domain\Core\TuneBuilder
|
||||
{
|
||||
$author = new Author($name, new EmailAtom(''));
|
||||
$author = Author::create($name, new EmailAtom(''));
|
||||
$this->tune->addAuthor($author);
|
||||
|
||||
return $this;
|
||||
|
||||
Reference in New Issue
Block a user