• File: VulnerabilityNotificationPolicyInterface.php
  • Full Path: /home/docteuh/www/Vulnerability/Interfaces/VulnerabilityNotificationPolicyInterface.php
  • Date Modified: 06/18/2026 4:25 PM
  • File size: 936 bytes
  • MIME-type: text/x-php
  • Charset: utf-8
<?php

namespace ReallySimplePlugins\RSS\Core\Features\Vulnerability\Interfaces;

use ReallySimplePlugins\RSS\Core\Features\Vulnerability\Dtos\VulnerabilitySnapshotDto;

/**
 * Defines the decision contract for sending vulnerability notification emails.
 *
 * Implementations encapsulate notification policy rules without performing delivery.
 */
interface VulnerabilityNotificationPolicyInterface
{
    /**
     * Determines whether a notification should be sent for the current snapshot.
     */
    public function shouldSend(VulnerabilitySnapshotDto $current, ?VulnerabilitySnapshotDto $previous): bool;

    /**
     * Determines whether notifications may be sent in the current execution context.
     */
    public function canSend(): bool;

    /**
     * Returns the reason for the last send decision, intended for logging or debugging.
     *
     * @return non-empty-string
     */
    public function getReason(): string;
}