1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-10-29 11:26:09 +01:00

Merge branch '2.x'

This commit is contained in:
Jordi Boggiano
2024-04-12 15:36:24 +02:00
11 changed files with 24 additions and 21 deletions

View File

@@ -150,7 +150,7 @@ class FilterHandler extends Handler implements ProcessableHandlerInterface, Rese
*
* If the handler was provided as a factory, this will trigger the handler's instantiation.
*/
public function getHandler(LogRecord $record = null): HandlerInterface
public function getHandler(LogRecord|null $record = null): HandlerInterface
{
if (!$this->handler instanceof HandlerInterface) {
$handler = ($this->handler)($record, $this);

View File

@@ -199,7 +199,7 @@ class FingersCrossedHandler extends Handler implements ProcessableHandlerInterfa
*
* If the handler was provided as a factory, this will trigger the handler's instantiation.
*/
public function getHandler(LogRecord $record = null): HandlerInterface
public function getHandler(LogRecord|null $record = null): HandlerInterface
{
if (!$this->handler instanceof HandlerInterface) {
$handler = ($this->handler)($record, $this);

View File

@@ -78,7 +78,7 @@ class SamplingHandler extends AbstractHandler implements ProcessableHandlerInter
*
* If the handler was provided as a factory, this will trigger the handler's instantiation.
*/
public function getHandler(LogRecord $record = null): HandlerInterface
public function getHandler(LogRecord|null $record = null): HandlerInterface
{
if (!$this->handler instanceof HandlerInterface) {
$handler = ($this->handler)($record, $this);

View File

@@ -86,7 +86,7 @@ class SlackRecord
bool $useShortAttachment = false,
bool $includeContextAndExtra = false,
array $excludeFields = [],
FormatterInterface $formatter = null
FormatterInterface|null $formatter = null
) {
$this
->setChannel($channel)

View File

@@ -111,9 +111,9 @@ class TelegramBotHandler extends AbstractProcessingHandler
string $channel,
$level = Level::Debug,
bool $bubble = true,
string $parseMode = null,
bool $disableWebPagePreview = null,
bool $disableNotification = null,
?string $parseMode = null,
?bool $disableWebPagePreview = null,
?bool $disableNotification = null,
bool $splitLongMessages = false,
bool $delayBetweenMessages = false,
int $topic = null
@@ -137,7 +137,7 @@ class TelegramBotHandler extends AbstractProcessingHandler
/**
* @return $this
*/
public function setParseMode(string $parseMode = null): self
public function setParseMode(string|null $parseMode = null): self
{
if ($parseMode !== null && !in_array($parseMode, self::AVAILABLE_PARSE_MODES, true)) {
throw new \InvalidArgumentException('Unknown parseMode, use one of these: ' . implode(', ', self::AVAILABLE_PARSE_MODES) . '.');
@@ -151,7 +151,7 @@ class TelegramBotHandler extends AbstractProcessingHandler
/**
* @return $this
*/
public function disableWebPagePreview(bool $disableWebPagePreview = null): self
public function disableWebPagePreview(bool|null $disableWebPagePreview = null): self
{
$this->disableWebPagePreview = $disableWebPagePreview;
@@ -161,7 +161,7 @@ class TelegramBotHandler extends AbstractProcessingHandler
/**
* @return $this
*/
public function disableNotification(bool $disableNotification = null): self
public function disableNotification(bool|null $disableNotification = null): self
{
$this->disableNotification = $disableNotification;