Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | n/a |
0 / 0 |
n/a |
0 / 0 |
CRAP | n/a |
0 / 0 |
|||
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | namespace App\Domain\Notification\Service; |
| 6 | |
| 7 | use App\Domain\Notification\Data\EmailMessage; |
| 8 | use RuntimeException; |
| 9 | |
| 10 | /** |
| 11 | * Domain contract for sending emails. |
| 12 | * |
| 13 | * Actions and services depend on this interface, never the concrete |
| 14 | * transport. Swap implementations via the DI container: |
| 15 | * - {@see SmtpEmailService} for real SMTP delivery |
| 16 | * - {@see \App\Test\Fake\FakeEmailService} for tests |
| 17 | */ |
| 18 | interface EmailServiceInterface |
| 19 | { |
| 20 | /** |
| 21 | * Send an email message. |
| 22 | * |
| 23 | * @param EmailMessage $message |
| 24 | * @throws RuntimeException on transport failure |
| 25 | */ |
| 26 | public function send(EmailMessage $message): void; |
| 27 | } |