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

Switch to DateTimeImmutable everywhere

This commit is contained in:
Jordi Boggiano
2016-05-20 20:55:31 +01:00
parent 6d2cfa63c9
commit e27225dc40
23 changed files with 78 additions and 78 deletions

View File

@@ -33,7 +33,7 @@ class ChromePHPHandler extends AbstractProcessingHandler
* Header name
*/
const HEADER_NAME = 'X-ChromeLogger-Data';
/**
* Regular expression to detect supported browsers (matches any Chrome, or Firefox 43+)
*/
@@ -146,7 +146,7 @@ class ChromePHPHandler extends AbstractProcessingHandler
'level' => Logger::WARNING,
'level_name' => Logger::getLevelName(Logger::WARNING),
'channel' => 'monolog',
'datetime' => new \DateTime(),
'datetime' => new \DateTimeImmutable(),
'extra' => array(),
);
self::$json['rows'][count(self::$json['rows']) - 1] = $this->getFormatter()->format($record);

View File

@@ -48,7 +48,7 @@ class RotatingFileHandler extends StreamHandler
{
$this->filename = $filename;
$this->maxFiles = (int) $maxFiles;
$this->nextRotation = new \DateTime('tomorrow');
$this->nextRotation = new \DateTimeImmutable('tomorrow');
$this->filenameFormat = '{filename}-{date}';
$this->dateFormat = 'Y-m-d';
@@ -112,7 +112,7 @@ class RotatingFileHandler extends StreamHandler
{
// update filename
$this->url = $this->getTimedFilename();
$this->nextRotation = new \DateTime('tomorrow');
$this->nextRotation = new \DateTimeImmutable('tomorrow');
// skip GC of old logs if files are unlimited
if (0 === $this->maxFiles) {