From dfbeb2c8d1118c940cd72e8ec851d22ed27a49a4 Mon Sep 17 00:00:00 2001 From: Wilmer Arambula Date: Tue, 13 Feb 2024 08:46:34 -0300 Subject: [PATCH] Fix issue psalm. --- src/Mailer.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Mailer.php b/src/Mailer.php index 6385d0c..ef20eb9 100644 --- a/src/Mailer.php +++ b/src/Mailer.php @@ -84,6 +84,7 @@ private function getTransport(): TransportInterface /** * @psalm-suppress UndefinedClass + * @psalm-suppress RedundantConditionGivenDocblockType * @throws InvalidConfigException * @throws \yii\di\NotInstantiableException */ @@ -92,6 +93,7 @@ private function getTransportFactory(): Transport if (isset($this->transportFactory)) { return $this->transportFactory; } + // Use the Yii DI container, if available. if (isset(Yii::$container)) { $factories = []; @@ -120,7 +122,7 @@ private function getTransportFactory(): Transport $factories = Transport::getDefaultFactories(); } - /** @psalm-suppress InvalidArgument Symfony's type annotation is wrong */ + /** @psalm-var array $factories */ return new Transport($factories); } @@ -154,7 +156,7 @@ private function createTransport(array $config = []): TransportInterface } /** - * @param MessageInterface&MessageWrapperInterface $message + * @param MessageInterface|MessageWrapperInterface $message * @throws \Symfony\Component\Mailer\Exception\TransportExceptionInterface */ protected function sendMessage($message): bool