Merge pull request #229 from creative-commoners/pulls/5/testmailer-signature

API Update method signatures
This commit is contained in:
Guy Sartorelli 2022-10-20 10:11:17 +13:00 committed by GitHub
commit 1786ce115d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 3 deletions

View File

@ -25,7 +25,7 @@ class TestMailer extends BaseTestMailer
/** /**
* Clear the log of emails sent * Clear the log of emails sent
*/ */
public function clearEmails() public function clearEmails(): void
{ {
$state = $this->testSessionEnvironment->getState(); $state = $this->testSessionEnvironment->getState();
if (isset($state->emails)) { if (isset($state->emails)) {
@ -34,8 +34,12 @@ class TestMailer extends BaseTestMailer
$this->testSessionEnvironment->applyState($state); $this->testSessionEnvironment->applyState($state);
} }
public function findEmail($to = null, $from = null, $subject = null, $content = null) public function findEmail(
{ string $to,
?string $from = null,
?string $subject = null,
?string $content = null
): ?array {
$matches = $this->findEmails($to, $from, $subject, $content); $matches = $this->findEmails($to, $from, $subject, $content);
//got the count of matches emails //got the count of matches emails
$emailCount = count($matches ?? []); $emailCount = count($matches ?? []);