1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-10-24 10:06:08 +02:00

Add constructor injection for SocketHandler and its children (#1600)

* feature: add constructor injection for `SocketHandler` and its children

Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>

* docs: add parameter documentation to `SocketHandler#__construct`

Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>
This commit is contained in:
Maximilian Bösing
2021-10-13 22:29:04 +02:00
committed by GitHub
parent d1c2829268
commit 4a11cadb27
8 changed files with 174 additions and 27 deletions

View File

@@ -59,13 +59,27 @@ class SlackHandler extends SocketHandler
bool $bubble = true,
bool $useShortAttachment = false,
bool $includeContextAndExtra = false,
array $excludeFields = array()
array $excludeFields = array(),
bool $persistent = false,
float $timeout = 0.0,
float $writingTimeout = 10.0,
?float $connectionTimeout = null,
?int $chunkSize = null
) {
if (!extension_loaded('openssl')) {
throw new MissingExtensionException('The OpenSSL PHP extension is required to use the SlackHandler');
}
parent::__construct('ssl://slack.com:443', $level, $bubble);
parent::__construct(
'ssl://slack.com:443',
$level,
$bubble,
$persistent,
$timeout,
$writingTimeout,
$connectionTimeout,
$chunkSize
);
$this->slackRecord = new SlackRecord(
$channel,