update patch 1
This commit is contained in:
Vendored
+3
-3
@@ -83,14 +83,14 @@ final class DatePoint extends \DateTimeImmutable
|
||||
}
|
||||
|
||||
if (!is_finite($timestamp) || \PHP_INT_MAX + 1.0 <= $timestamp || \PHP_INT_MIN > $timestamp) {
|
||||
throw new \DateRangeError(sprintf('DateTimeImmutable::createFromTimestamp(): Argument #1 ($timestamp) must be a finite number between %s and %s.999999, %s given', \PHP_INT_MIN, \PHP_INT_MAX, $timestamp));
|
||||
throw new \DateRangeError(\sprintf('DateTimeImmutable::createFromTimestamp(): Argument #1 ($timestamp) must be a finite number between %s and %s.999999, %s given', \PHP_INT_MIN, \PHP_INT_MAX, $timestamp));
|
||||
}
|
||||
|
||||
if ($timestamp < 0) {
|
||||
$timestamp = (int) $timestamp - 2.0 + $ms;
|
||||
}
|
||||
|
||||
return static::createFromFormat('U.u', sprintf('%.6F', $timestamp));
|
||||
return static::createFromFormat('U.u', \sprintf('%.6F', $timestamp));
|
||||
}
|
||||
|
||||
public function add(\DateInterval $interval): static
|
||||
@@ -109,7 +109,7 @@ final class DatePoint extends \DateTimeImmutable
|
||||
public function modify(string $modifier): static
|
||||
{
|
||||
if (\PHP_VERSION_ID < 80300) {
|
||||
return @parent::modify($modifier) ?: throw new \DateMalformedStringException(error_get_last()['message'] ?? sprintf('Invalid modifier: "%s".', $modifier));
|
||||
return @parent::modify($modifier) ?: throw new \DateMalformedStringException(error_get_last()['message'] ?? \sprintf('Invalid modifier: "%s".', $modifier));
|
||||
}
|
||||
|
||||
return parent::modify($modifier);
|
||||
|
||||
Vendored
+2
-2
@@ -55,7 +55,7 @@ final class MockClock implements ClockInterface
|
||||
public function sleep(float|int $seconds): void
|
||||
{
|
||||
$now = (float) $this->now->format('Uu') + $seconds * 1e6;
|
||||
$now = substr_replace(sprintf('@%07.0F', $now), '.', -6, 0);
|
||||
$now = substr_replace(\sprintf('@%07.0F', $now), '.', -6, 0);
|
||||
$timezone = $this->now->getTimezone();
|
||||
|
||||
$this->now = DatePoint::createFromInterface(new \DateTimeImmutable($now, $timezone))->setTimezone($timezone);
|
||||
@@ -67,7 +67,7 @@ final class MockClock implements ClockInterface
|
||||
public function modify(string $modifier): void
|
||||
{
|
||||
if (\PHP_VERSION_ID < 80300) {
|
||||
$this->now = @$this->now->modify($modifier) ?: throw new \DateMalformedStringException(error_get_last()['message'] ?? sprintf('Invalid modifier: "%s". Could not modify MockClock.', $modifier));
|
||||
$this->now = @$this->now->modify($modifier) ?: throw new \DateMalformedStringException(error_get_last()['message'] ?? \sprintf('Invalid modifier: "%s". Could not modify MockClock.', $modifier));
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user