summaryrefslogtreecommitdiffstats
path: root/src/Monolog/Formatter/ElasticaFormatter.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/Monolog/Formatter/ElasticaFormatter.php')
-rw-r--r--src/Monolog/Formatter/ElasticaFormatter.php21
1 files changed, 5 insertions, 16 deletions
diff --git a/src/Monolog/Formatter/ElasticaFormatter.php b/src/Monolog/Formatter/ElasticaFormatter.php
index 4c556cf..a6354f5 100644
--- a/src/Monolog/Formatter/ElasticaFormatter.php
+++ b/src/Monolog/Formatter/ElasticaFormatter.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
/*
* This file is part of the Monolog package.
@@ -34,7 +34,7 @@ class ElasticaFormatter extends NormalizerFormatter
* @param string $index Elastic Search index name
* @param string $type Elastic Search document type
*/
- public function __construct($index, $type)
+ public function __construct(string $index, string $type)
{
// elasticsearch requires a ISO 8601 format date with optional millisecond precision.
parent::__construct('Y-m-d\TH:i:s.uP');
@@ -53,31 +53,20 @@ class ElasticaFormatter extends NormalizerFormatter
return $this->getDocument($record);
}
- /**
- * Getter index
- * @return string
- */
- public function getIndex()
+ public function getIndex(): string
{
return $this->index;
}
- /**
- * Getter type
- * @return string
- */
- public function getType()
+ public function getType(): string
{
return $this->type;
}
/**
* Convert a log message into an Elastica Document
- *
- * @param array $record Log message
- * @return Document
*/
- protected function getDocument($record)
+ protected function getDocument(array $record): Document
{
$document = new Document();
$document->setData($record);