Commit 50f870a
committed
feature #42433 [Notifier] Add more explicit error if a SMSChannel doesn't have a Recipient (ismail1432)
This PR was merged into the 5.4 branch.
Discussion
----------
[Notifier] Add more explicit error if a SMSChannel doesn't have a Recipient
| Q | A
| ------------- | ---
| Branch? | 5.4
| Bug fix? | yes
| New feature? | yes
| License | MIT
Improve error message if a `SmSChannel` doesn't have a Recipient. ATM The snippet bellow output the message:
`The "sms" channel is not supported.` because the `SmsChannel::supports` return `false` if you pass an instance of `NoRecipient`.
This PR improve the error message with : "The "sms" channel needs a Recipient."
```php
<?php
$notifier = new Notifier(['sms' => new SmsChannel(new NullTransport())]);
$notifier->send(new Notification("Hello World!", ["sms/twilio"]));
Commits
-------
45d577f9b8 add more explicit error2 files changed
+30
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| |||
89 | 90 | | |
90 | 91 | | |
91 | 92 | | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
92 | 97 | | |
93 | 98 | | |
94 | 99 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
0 commit comments