Skip to content

Commit

Permalink
Fix issue psalm.
Browse files Browse the repository at this point in the history
  • Loading branch information
terabytesoftw committed Feb 13, 2024
1 parent 523c380 commit dfbeb2c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Mailer.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ private function getTransport(): TransportInterface

/**
* @psalm-suppress UndefinedClass
* @psalm-suppress RedundantConditionGivenDocblockType
* @throws InvalidConfigException
* @throws \yii\di\NotInstantiableException
*/
Expand All @@ -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 = [];
Expand Down Expand Up @@ -120,7 +122,7 @@ private function getTransportFactory(): Transport
$factories = Transport::getDefaultFactories();
}

/** @psalm-suppress InvalidArgument Symfony's type annotation is wrong */
/** @psalm-var array<array-key, \Symfony\Component\Mailer\Transport\TransportFactoryInterface> $factories */
return new Transport($factories);
}

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit dfbeb2c

Please sign in to comment.