feat(scraping): implémenter le health check de tous les scrapers
- Commande CheckAllScrapersHealth + handler avec ports dédiés - Value Object ContentSourceHealthCheckData - Resource API Platform et State Processor - Adapters InMemory et tests unitaires + fonctionnels
This commit is contained in:
parent
734dea569c
commit
ae7a485195
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
namespace App\Tests\Domain\Scraping\Adapter;
|
||||
|
||||
use App\Domain\Scraping\Domain\Contract\Repository\ContentSourceForHealthCheckInterface;
|
||||
use App\Domain\Scraping\Domain\Model\ValueObject\ContentSourceHealthCheckData;
|
||||
|
||||
class InMemoryContentSourceForHealthCheckRepository implements ContentSourceForHealthCheckInterface
|
||||
{
|
||||
/** @var ContentSourceHealthCheckData[] */
|
||||
private array $sources = [];
|
||||
|
||||
public function add(ContentSourceHealthCheckData $data): void
|
||||
{
|
||||
$this->sources[] = $data;
|
||||
}
|
||||
|
||||
public function getAll(): array
|
||||
{
|
||||
return $this->sources;
|
||||
}
|
||||
|
||||
public function clear(): void
|
||||
{
|
||||
$this->sources = [];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user