1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-10-21 16:46:11 +02:00

Move to strict mode and fix tests

This commit is contained in:
Jordi Boggiano
2016-05-27 13:44:00 +01:00
parent 788902b320
commit 21dde4dedb
170 changed files with 239 additions and 240 deletions

View File

@@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
/*
* This file is part of the Monolog package.
@@ -23,11 +23,13 @@ class DateTimeImmutable extends \DateTimeImmutable implements \JsonSerializable
public function __construct($useMicroseconds, \DateTimeZone $timezone = null)
{
$date = null;
$date = 'now';
if ($useMicroseconds) {
// Circumvent DateTimeImmutable::createFromFormat() which always returns \DateTimeImmutable instead of `static`
// @link https://bugs.php.net/bug.php?id=60302
$timestamp = microtime(true);
$microseconds = sprintf("%06d", ($timestamp - floor($timestamp)) * 1000000);
$date = date('Y-m-d H:i:s.' . $microseconds, $timestamp);
$date = date('Y-m-d H:i:s.' . $microseconds, (int) $timestamp);
}
parent::__construct($date, $timezone);