1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-10-29 03:16:21 +01:00

Add Record/Level/LevelName type aliases and improve phpstan type coverage to level 6

This commit is contained in:
Jordi Boggiano
2021-05-28 10:29:33 +02:00
parent 5c9d9bf43e
commit 01d104aa78
88 changed files with 791 additions and 180 deletions

View File

@@ -21,14 +21,18 @@ use Swift;
* SwiftMailerHandler uses Swift_Mailer to send the emails
*
* @author Gyula Sallai
*
* @phpstan-import-type Record from \Monolog\Logger
*/
class SwiftMailerHandler extends MailHandler
{
/** @var \Swift_Mailer */
protected $mailer;
/** @var Swift_Message|callable(string, Record[]): Swift_Message */
private $messageTemplate;
/**
* @psalm-param Swift_Message|callable(string, array): Swift_Message $message
* @psalm-param Swift_Message|callable(string, Record[]): Swift_Message $message
*
* @param \Swift_Mailer $mailer The mailer to use
* @param callable|Swift_Message $message An example message for real messages, only the body will be replaced
@@ -67,6 +71,8 @@ class SwiftMailerHandler extends MailHandler
* @param string $content formatted email body to be sent
* @param array $records Log records that formed the content
* @return Swift_Message
*
* @phpstan-param Record[] $records
*/
protected function buildMessage(string $content, array $records): Swift_Message
{