Do not use static::class for final messages

This commit is contained in:
Tomas 2021-06-18 06:38:56 +03:00 committed by Nicolas Grekas
parent 53c06ea546
commit 69f6409731
2 changed files with 2 additions and 2 deletions

View File

@ -39,7 +39,7 @@ final class EmailMessage implements MessageInterface
public static function fromNotification(Notification $notification, EmailRecipientInterface $recipient): self
{
if ('' === $recipient->getEmail()) {
throw new InvalidArgumentException(sprintf('"%s" needs an email, it cannot be empty.', static::class));
throw new InvalidArgumentException(sprintf('"%s" needs an email, it cannot be empty.', __CLASS__));
}
if (!class_exists(NotificationEmail::class)) {

View File

@ -29,7 +29,7 @@ final class SmsMessage implements MessageInterface
public function __construct(string $phone, string $subject)
{
if ('' === $phone) {
throw new InvalidArgumentException(sprintf('"%s" needs a phone number, it cannot be empty.', static::class));
throw new InvalidArgumentException(sprintf('"%s" needs a phone number, it cannot be empty.', __CLASS__));
}
$this->subject = $subject;