TenantAtlas/app/Services/Drift/DriftEvidence.php
2026-01-13 23:48:16 +01:00

32 lines
605 B
PHP

<?php
namespace App\Services\Drift;
class DriftEvidence
{
/**
* @param array<string, mixed> $payload
* @return array<string, mixed>
*/
public function sanitize(array $payload): array
{
$allowedKeys = [
'change_type',
'summary',
'baseline',
'current',
'diff',
'notes',
];
$safe = [];
foreach ($allowedKeys as $key) {
if (array_key_exists($key, $payload)) {
$safe[$key] = $payload[$key];
}
}
return $safe;
}
}