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

Added phpdoc for all methods and added the typehint for the FormatterInterface

This commit is contained in:
Christophe Coevoet
2011-04-06 00:50:18 +02:00
parent c6f59a7b7c
commit 87332a3e4e
14 changed files with 247 additions and 48 deletions

View File

@@ -28,13 +28,20 @@ class LineFormatter implements FormatterInterface
protected $format;
protected $dateFormat;
/**
* @param string $format The format of the message
* @param string $dateFormat The format of the timestamp: one supported by DateTime::format
*/
public function __construct($format = null, $dateFormat = null)
{
$this->format = $format ?: self::SIMPLE_FORMAT;
$this->dateFormat = $dateFormat ?: self::SIMPLE_DATE;
}
public function format($record)
/**
* {@inheritdoc}
*/
public function format(array $record)
{
$vars = $record;
$vars['datetime'] = $vars['datetime']->format($this->dateFormat);
@@ -56,6 +63,7 @@ class LineFormatter implements FormatterInterface
$output = str_replace('%extra.'.$var.'%', $val, $output);
}
$record['message'] = $output;
return $record;
}
}