mirror of
https://github.com/koel/koel
synced 2024-11-24 21:23:06 +00:00
a8a3baa478
This reverts commit 7cd5b230d4
.
37 lines
1,019 B
PHP
37 lines
1,019 B
PHP
<?php
|
|
|
|
namespace App\Values;
|
|
|
|
use Illuminate\Support\Collection;
|
|
|
|
final class SyncResultCollection extends Collection
|
|
{
|
|
public static function create(): self
|
|
{
|
|
return new self();
|
|
}
|
|
|
|
/** @return Collection|array<array-key, SyncResult> */
|
|
public function valid(): Collection
|
|
{
|
|
return $this->filter(static fn (SyncResult $result): bool => $result->isValid());
|
|
}
|
|
|
|
/** @return Collection|array<array-key, SyncResult> */
|
|
public function success(): Collection
|
|
{
|
|
return $this->filter(static fn (SyncResult $result): bool => $result->isSuccess());
|
|
}
|
|
|
|
/** @return Collection|array<array-key, SyncResult> */
|
|
public function skipped(): Collection
|
|
{
|
|
return $this->filter(static fn (SyncResult $result): bool => $result->isSkipped());
|
|
}
|
|
|
|
/** @return Collection|array<array-key, SyncResult> */
|
|
public function error(): Collection
|
|
{
|
|
return $this->filter(static fn (SyncResult $result): bool => $result->isError());
|
|
}
|
|
}
|