Skip to content

Commit 0aa947e

Browse files
deguiffabpot
authored andcommitted
Replace get_class() calls by ::class
1 parent ee72646 commit 0aa947e

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Notification/Notification.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ public function getEmoji(): string
139139
*/
140140
public function exception(\Throwable $exception): static
141141
{
142-
$parts = explode('\\', \get_class($exception));
142+
$parts = explode('\\', $exception::class);
143143

144144
$this->subject = sprintf('%s: %s', array_pop($parts), $exception->getMessage());
145145
if (class_exists(FlattenException::class)) {
@@ -202,7 +202,7 @@ private function computeExceptionAsString(\Throwable $exception): string
202202
return $exception->getAsString();
203203
}
204204

205-
$message = \get_class($exception);
205+
$message = $exception::class;
206206
if ('' !== $exception->getMessage()) {
207207
$message .= ': '.$exception->getMessage();
208208
}

Notifier.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ private function getChannels(Notification $notification, RecipientInterface $rec
7272
{
7373
$channels = $notification->getChannels($recipient);
7474
if (!$channels) {
75-
$errorPrefix = sprintf('Unable to determine which channels to use to send the "%s" notification', \get_class($notification));
75+
$errorPrefix = sprintf('Unable to determine which channels to use to send the "%s" notification', $notification::class);
7676
$error = 'you should either pass channels in the constructor, override its "getChannels()" method';
7777
if (null === $this->policy) {
7878
throw new LogicException(sprintf('%s; %s, or configure a "%s".', $errorPrefix, $error, ChannelPolicy::class));

0 commit comments

Comments
 (0)