Some checks failed
abc-api/abcParser/pipeline/head There was a failure building this commit
33 lines
726 B
PHP
Executable File
33 lines
726 B
PHP
Executable File
<?php
|
|
namespace XaiCorp\AbcParser\Domain\Core;
|
|
|
|
class TuneCollection extends Collection
|
|
{
|
|
/**
|
|
* Get the value of the first element in this collection.
|
|
*
|
|
* @throws \Enzyme\Collection\CollectionException If the collection is empty.
|
|
*
|
|
* @return \XaiCorp\AbcParser\Domain\Core\Tune
|
|
*/
|
|
public function first()
|
|
{
|
|
return parent::first();
|
|
}
|
|
|
|
public function unique()
|
|
{
|
|
$result = [];
|
|
/**
|
|
* @var int $key
|
|
* @var Tune $tune
|
|
*/
|
|
foreach ($this->items as $key => $tune) {
|
|
$tuneId = $tune->getETag();
|
|
$result[$tuneId] = $tune;
|
|
}
|
|
|
|
return new TuneCollection(array_values($result));
|
|
}
|
|
}
|