<?php
namespace App\Values\Scanning;
use Illuminate\Support\Collection;
final class ScanResultCollection extends Collection
{
public static function create(): self
{
return new self();
}
public function valid(): Collection
{
return $this->filter(static fn (ScanResult $result): bool => $result->isValid());
}
public function success(): Collection
{
return $this->filter(static fn (ScanResult $result): bool => $result->isSuccess());
}
public function skipped(): Collection
{
return $this->filter(static fn (ScanResult $result): bool => $result->isSkipped());
}
public function error(): Collection
{
return $this->filter(static fn (ScanResult $result): bool => $result->isError());
}
}