Skip to content

Commit 1dab3f5

Browse files
committed
Changed after code review
1 parent 5f00690 commit 1dab3f5

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/Symfony/Component/Notifier/CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ CHANGELOG
99
* The `EmailRecipientInterface` and `RecipientInterface` were introduced.
1010
* Added `email` and and `phone` properties to `Recipient`.
1111
* [BC BREAK] Changed the type-hint of the `$recipient` argument in the `as*Message()`
12-
of the `EmailNotificationInterface` and `SmsNotificationInterface` to `EmailRecipientInterface`
13-
and `SmsRecipientInterface`.
12+
of the `EmailNotificationInterface` and `SmsNotificationInterface` to `EmailRecipientInterface`
13+
and `SmsRecipientInterface`.
1414
* [BC BREAK] Removed the `AdminRecipient`.
1515
* The `EmailRecipientInterface` and `SmsRecipientInterface` now extend the `RecipientInterface`.
1616
* The `EmailRecipient` and `SmsRecipient` were introduced.

src/Symfony/Component/Notifier/Recipient/Recipient.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class Recipient implements EmailRecipientInterface, SmsRecipientInterface
2626

2727
public function __construct(string $email = '', string $phone = '')
2828
{
29-
if (empty(trim($email)) && empty(trim($phone))) {
29+
if ('' === $email && '' === $phone) {
3030
throw new InvalidArgumentException(sprintf('"%s" needs an email or a phone but both cannot be empty.', static::class));
3131
}
3232

@@ -45,6 +45,8 @@ public function email(string $email): self
4545
}
4646

4747
/**
48+
* Sets the phone number (no spaces, international code like in +3312345678).
49+
*
4850
* @return $this
4951
*/
5052
public function phone(string $phone): self

0 commit comments

Comments
 (0)