summaryrefslogtreecommitdiffstats
path: root/src/Monolog/Formatter/FluentdFormatter.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/Monolog/Formatter/FluentdFormatter.php')
-rw-r--r--src/Monolog/Formatter/FluentdFormatter.php18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/Monolog/Formatter/FluentdFormatter.php b/src/Monolog/Formatter/FluentdFormatter.php
index 02632bb..a84f826 100644
--- a/src/Monolog/Formatter/FluentdFormatter.php
+++ b/src/Monolog/Formatter/FluentdFormatter.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
/*
* This file is part of the Monolog package.
@@ -39,41 +39,41 @@ class FluentdFormatter implements FormatterInterface
*/
protected $levelTag = false;
- public function __construct($levelTag = false)
+ public function __construct(bool $levelTag = false)
{
if (!function_exists('json_encode')) {
throw new \RuntimeException('PHP\'s json extension is required to use Monolog\'s FluentdUnixFormatter');
}
- $this->levelTag = (bool) $levelTag;
+ $this->levelTag = $levelTag;
}
- public function isUsingLevelsInTag()
+ public function isUsingLevelsInTag(): bool
{
return $this->levelTag;
}
- public function format(array $record)
+ public function format(array $record): string
{
$tag = $record['channel'];
if ($this->levelTag) {
$tag .= '.' . strtolower($record['level_name']);
}
- $message = array(
+ $message = [
'message' => $record['message'],
'extra' => $record['extra'],
- );
+ ];
if (!$this->levelTag) {
$message['level'] = $record['level'];
$message['level_name'] = $record['level_name'];
}
- return json_encode(array($tag, $record['datetime']->getTimestamp(), $message));
+ return json_encode([$tag, $record['datetime']->getTimestamp(), $message]);
}
- public function formatBatch(array $records)
+ public function formatBatch(array $records): string
{
$message = '';
foreach ($records as $record) {