mirror of
https://github.com/Seldaek/monolog.git
synced 2025-08-05 04:37:38 +02:00
Add type hints and fix formatting
This commit is contained in:
@@ -34,6 +34,7 @@
|
|||||||
- _HipChatHandler_: Logs records to a [HipChat](http://hipchat.com) chat room using its API.
|
- _HipChatHandler_: Logs records to a [HipChat](http://hipchat.com) chat room using its API.
|
||||||
- _FlowdockHandler_: Logs records to a [Flowdock](https://www.flowdock.com/) account.
|
- _FlowdockHandler_: Logs records to a [Flowdock](https://www.flowdock.com/) account.
|
||||||
- _SlackHandler_: Logs records to a [Slack](https://www.slack.com/) account.
|
- _SlackHandler_: Logs records to a [Slack](https://www.slack.com/) account.
|
||||||
|
- _SendGridHandler_: Sends emails via the SendGrid API.
|
||||||
- _MandrillHandler_: Sends emails via the Mandrill API using a [`Swift_Message`](http://swiftmailer.org/) instance.
|
- _MandrillHandler_: Sends emails via the Mandrill API using a [`Swift_Message`](http://swiftmailer.org/) instance.
|
||||||
- _FleepHookHandler_: Logs records to a [Fleep](https://fleep.io/) conversation using Webhooks.
|
- _FleepHookHandler_: Logs records to a [Fleep](https://fleep.io/) conversation using Webhooks.
|
||||||
- _IFTTTHandler_: Notifies an [IFTTT](https://ifttt.com/maker) trigger with the log channel, level name and message.
|
- _IFTTTHandler_: Notifies an [IFTTT](https://ifttt.com/maker) trigger with the log channel, level name and message.
|
||||||
|
@@ -59,13 +59,13 @@ class SendGridHandler extends MailHandler
|
|||||||
* @param int $level The minimum logging level at which this handler will be triggered
|
* @param int $level The minimum logging level at which this handler will be triggered
|
||||||
* @param bool $bubble Whether the messages that are handled can bubble up the stack or not
|
* @param bool $bubble Whether the messages that are handled can bubble up the stack or not
|
||||||
*/
|
*/
|
||||||
public function __construct($apiUser, $apiKey, $from, $to, $subject, $level = Logger::ERROR, $bubble = true)
|
public function __construct(string $apiUser, string $apiKey, string $from, $to, string $subject, int $level = Logger::ERROR, bool $bubble = true)
|
||||||
{
|
{
|
||||||
parent::__construct($level, $bubble);
|
parent::__construct($level, $bubble);
|
||||||
$this->apiUser = $apiUser;
|
$this->apiUser = $apiUser;
|
||||||
$this->apiKey = $apiKey;
|
$this->apiKey = $apiKey;
|
||||||
$this->from = $from;
|
$this->from = $from;
|
||||||
$this->to = is_array($to) ? $to : array($to);
|
$this->to = (array) $to;
|
||||||
$this->subject = $subject;
|
$this->subject = $subject;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -78,8 +78,8 @@ class SendGridHandler extends MailHandler
|
|||||||
$message['api_user'] = $this->apiUser;
|
$message['api_user'] = $this->apiUser;
|
||||||
$message['api_key'] = $this->apiKey;
|
$message['api_key'] = $this->apiKey;
|
||||||
$message['from'] = $this->from;
|
$message['from'] = $this->from;
|
||||||
foreach ($this->to AS $v) {
|
foreach ($this->to as $recipient) {
|
||||||
$message['to[]'] = $v;
|
$message['to[]'] = $recipient;
|
||||||
}
|
}
|
||||||
$message['subject'] = $this->subject;
|
$message['subject'] = $this->subject;
|
||||||
$message['text'] = $content;
|
$message['text'] = $content;
|
||||||
|
Reference in New Issue
Block a user