From 055b56584ec3472fe090d5ddd1d8cdc86d21a25d Mon Sep 17 00:00:00 2001 From: Scott Sutherland <38484948+scott-nz@users.noreply.github.com> Date: Fri, 10 Nov 2023 12:25:01 +1300 Subject: [PATCH] correct required type for findEmail() $to Follows same logic as thereIsAnEmailTitled() which sets the $to param of findEmail() to an empty string --- src/Context/EmailContext.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Context/EmailContext.php b/src/Context/EmailContext.php index bef2257..e16a13d 100644 --- a/src/Context/EmailContext.php +++ b/src/Context/EmailContext.php @@ -64,7 +64,7 @@ class EmailContext implements Context */ public function thereIsAnEmailFromTo($negate, $direction, $email) { - $to = ($direction == 'to') ? $email : null; + $to = ($direction == 'to') ? $email : ''; $from = ($direction == 'from') ? $email : null; $match = $this->mailer->findEmail($to, $from); if (trim($negate ?? '')) { @@ -84,7 +84,7 @@ class EmailContext implements Context */ public function thereIsAnEmailFromToTitled($negate, $direction, $email, $subject) { - $to = ($direction == 'to') ? $email : null; + $to = ($direction == 'to') ? $email : ''; $from = ($direction == 'from') ? $email : null; $match = $this->mailer->findEmail($to, $from, $subject); $allMails = $this->mailer->findEmails($to, $from);