TenantAtlas/apps/platform/app/Support/Operations/Reconciliation/OperationRunReconciliationRegistry.php
ahmido 252cd4513d feat: implement report evidence reconciliation (#432)
Implemented report evidence reconciliation.

Co-authored-by: Ahmed Darrazi <ahmed.darrazi@live.de>
Reviewed-on: #432
2026-06-06 22:40:59 +00:00

53 lines
1.5 KiB
PHP

<?php
declare(strict_types=1);
namespace App\Support\Operations\Reconciliation;
final class OperationRunReconciliationRegistry
{
public function __construct(
private readonly RestoreExecuteReconciliationAdapter $restoreExecuteAdapter,
private readonly EnvironmentReviewComposeReconciliationAdapter $environmentReviewComposeAdapter,
private readonly EvidenceSnapshotReconciliationAdapter $evidenceSnapshotAdapter,
private readonly ReviewPackArtifactReconciliationAdapter $reviewPackAdapter,
) {}
/**
* @return array<int, OperationRunReconciliationAdapter>
*/
public function all(): array
{
return [
$this->restoreExecuteAdapter,
$this->environmentReviewComposeAdapter,
$this->evidenceSnapshotAdapter,
$this->reviewPackAdapter,
];
}
/**
* @return array<int, string>
*/
public function supportedTypes(): array
{
return array_values(array_unique(array_merge(
$this->restoreExecuteAdapter->supportedTypes(),
$this->environmentReviewComposeAdapter->supportedTypes(),
$this->evidenceSnapshotAdapter->supportedTypes(),
$this->reviewPackAdapter->supportedTypes(),
)));
}
public function forType(string $type): ?OperationRunReconciliationAdapter
{
foreach ($this->all() as $adapter) {
if ($adapter->supportsType($type)) {
return $adapter;
}
}
return null;
}
}