Blocklist.php 647 B

123456789101112131415161718192021222324252627282930
  1. <?php
  2. declare(strict_types=1);
  3. namespace App\Domain\Reputation;
  4. use DateTimeImmutable;
  5. /**
  6. * The full result of evaluating a policy against the current data set.
  7. * Wraps the entry list with metadata used by the distribution endpoint
  8. * (count, generation timestamp, policy name).
  9. */
  10. final class Blocklist
  11. {
  12. /**
  13. * @param list<BlocklistEntry> $entries
  14. */
  15. public function __construct(
  16. public readonly array $entries,
  17. public readonly string $policyName,
  18. public readonly DateTimeImmutable $generatedAt,
  19. ) {
  20. }
  21. public function count(): int
  22. {
  23. return count($this->entries);
  24. }
  25. }