Skip to content

Commit 9ba4376

Browse files
committed
Add types
1 parent a4badad commit 9ba4376

File tree

1 file changed

+3
-12
lines changed

1 file changed

+3
-12
lines changed

src/email.php

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,8 @@
55
if (!function_exists('is_email')) {
66
/**
77
* Check whether the given string is an email address or not.
8-
*
9-
* @param mixed $string
10-
* @return bool
118
*/
12-
function is_email($string)
9+
function is_email(mixed $string): bool
1310
{
1411
return (bool) filter_var($string, FILTER_VALIDATE_EMAIL);
1512
}
@@ -21,11 +18,8 @@ function is_email($string)
2118
*
2219
* @see http://faqs.org/rfcs/rfc2822.html
2320
* @see https://php.net/manual/en/function.mail.php
24-
*
25-
* @param array $addresses
26-
* @return string
2721
*/
28-
function to_rfc2822_email(array $addresses)
22+
function to_rfc2822_email(array $addresses): string
2923
{
3024
// Check if we're dealing with one address, without multiarray
3125
$addresses = !empty($addresses['address']) ? [$addresses] : $addresses;
@@ -51,11 +45,8 @@ function to_rfc2822_email(array $addresses)
5145
* Convert addresses data to SwiftMailer-suitable format.
5246
*
5347
* @see https://swiftmailer.org/docs/messages.html
54-
*
55-
* @param array $addresses
56-
* @return array
5748
*/
58-
function to_swiftmailer_emails(array $addresses)
49+
function to_swiftmailer_emails(array $addresses): array
5950
{
6051
// Check if we're dealing with one address, without multiarray
6152
$addresses = !empty($addresses['address']) ? [$addresses] : $addresses;

0 commit comments

Comments
 (0)