Skip to content

Commit 4a0e59a

Browse files
minor #35945 Leverage PHP8's get_debug_type() (nicolas-grekas)
This PR was merged into the 5.1-dev branch. Discussion ---------- Leverage PHP8's get_debug_type() | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | no | Deprecations? | no | Tickets | - | License | MIT | Doc PR | - See symfony/polyfill#226 for background. We might have to port part of the patch to 4.4 when we'll work on having it support PHP 8, but that's not needed for now. Commits ------- daf1c6605e Leverage PHP8's get_debug_type()
2 parents 6638d6b + af44ce8 commit 4a0e59a

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

Channel/EmailChannel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public function notify(Notification $notification, Recipient $recipient, string
5858
if ($email instanceof Email) {
5959
if (!$email->getFrom()) {
6060
if (null === $this->from) {
61-
throw new LogicException(sprintf('To send the "%s" notification by email, you should either configure a global "from" or set it in the "asEmailMessage()" method.', \get_class($notification)));
61+
throw new LogicException(sprintf('To send the "%s" notification by email, you should either configure a global "from" or set it in the "asEmailMessage()" method.', get_debug_type($notification)));
6262
}
6363

6464
$email->from($this->from);

Message/SmsMessage.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public function __construct(string $phone, string $subject)
3737
public static function fromNotification(Notification $notification, Recipient $recipient): self
3838
{
3939
if (!$recipient instanceof SmsRecipientInterface) {
40-
throw new LogicException(sprintf('To send a SMS message, "%s" should implement "%s" or the recipient should implement "%s".', \get_class($notification), SmsNotificationInterface::class, SmsRecipientInterface::class));
40+
throw new LogicException(sprintf('To send a SMS message, "%s" should implement "%s" or the recipient should implement "%s".', get_debug_type($notification), SmsNotificationInterface::class, SmsRecipientInterface::class));
4141
}
4242

4343
return new self($recipient->getPhone(), $notification->getSubject());

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
}
1717
],
1818
"require": {
19-
"php": "^7.2.5"
19+
"php": "^7.2.5",
20+
"symfony/polyfill-php80": "^1.15"
2021
},
2122
"conflict": {
2223
"symfony/http-kernel": "<4.4"

0 commit comments

Comments
 (0)