From f458b11720db1c0e2dc960a13d86d33fc94882be Mon Sep 17 00:00:00 2001 From: Vasilij Dusko Date: Wed, 2 Aug 2023 22:59:48 +0300 Subject: [PATCH] transport can be null --- .../FrameworkBundle/Test/NotificationAssertionsTrait.php | 4 ++-- .../Notifier/Test/Constraint/NotificationTransportIsEqual.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Symfony/Bundle/FrameworkBundle/Test/NotificationAssertionsTrait.php b/src/Symfony/Bundle/FrameworkBundle/Test/NotificationAssertionsTrait.php index 30298ef04c54f..14cff4236b2ae 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Test/NotificationAssertionsTrait.php +++ b/src/Symfony/Bundle/FrameworkBundle/Test/NotificationAssertionsTrait.php @@ -52,12 +52,12 @@ public static function assertNotificationSubjectNotContains(MessageInterface $no self::assertThat($notification, new LogicalNot(new NotifierConstraint\NotificationSubjectContains($text)), $message); } - public static function assertNotificationTransportIsEqual(MessageInterface $notification, string $transportName, string $message = ''): void + public static function assertNotificationTransportIsEqual(MessageInterface $notification, ?string $transportName = null, string $message = ''): void { self::assertThat($notification, new NotifierConstraint\NotificationTransportIsEqual($transportName), $message); } - public static function assertNotificationTransportIsNotEqual(MessageInterface $notification, string $transportName, string $message = ''): void + public static function assertNotificationTransportIsNotEqual(MessageInterface $notification, ?string $transportName = null, string $message = ''): void { self::assertThat($notification, new LogicalNot(new NotifierConstraint\NotificationTransportIsEqual($transportName)), $message); } diff --git a/src/Symfony/Component/Notifier/Test/Constraint/NotificationTransportIsEqual.php b/src/Symfony/Component/Notifier/Test/Constraint/NotificationTransportIsEqual.php index 16b1c2b4e3134..990e31daccdf2 100644 --- a/src/Symfony/Component/Notifier/Test/Constraint/NotificationTransportIsEqual.php +++ b/src/Symfony/Component/Notifier/Test/Constraint/NotificationTransportIsEqual.php @@ -19,9 +19,9 @@ */ final class NotificationTransportIsEqual extends Constraint { - private $expectedText; + private ?string $expectedText; - public function __construct(string $expectedText) + public function __construct(?string $expectedText) { $this->expectedText = $expectedText; }