32 lines
866 B
PHP
32 lines
866 B
PHP
<?php
|
|
|
|
namespace Modules\Core\Privacy;
|
|
|
|
/**
|
|
* Every registered provider's outcome, assembled into one right-of-erasure response
|
|
* — the audit trail proving what happened and, for anything not fully erased, why.
|
|
* $subject is whichever scope the request was for — see docs/privacy.md
|
|
* "User-scope vs Customer-scope".
|
|
*/
|
|
class ErasureReport
|
|
{
|
|
/**
|
|
* @param array<int, ProviderErasureResult> $results
|
|
*/
|
|
public function __construct(
|
|
public readonly UserSubject|CustomerSubject $subject,
|
|
public readonly array $results,
|
|
) {}
|
|
|
|
/**
|
|
* @return array<int, ProviderErasureResult>
|
|
*/
|
|
public function retained(): array
|
|
{
|
|
return array_values(array_filter(
|
|
$this->results,
|
|
fn (ProviderErasureResult $result) => $result->outcome === ErasureOutcome::Retained
|
|
));
|
|
}
|
|
}
|