From db5433a9959b25a5c574758c1b4f885904c5ac60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lu=C3=ADs=20Cobucci?= Date: Thu, 27 Aug 2020 20:39:59 +0200 Subject: [PATCH] Always require a timezone to create the SystemClock --- src/SystemClock.php | 4 ++-- test/SystemClockTest.php | 10 ---------- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/src/SystemClock.php b/src/SystemClock.php index 975ef0fb..f40559c5 100644 --- a/src/SystemClock.php +++ b/src/SystemClock.php @@ -12,9 +12,9 @@ final class SystemClock implements Clock { private DateTimeZone $timezone; - public function __construct(?DateTimeZone $timezone = null) + public function __construct(DateTimeZone $timezone) { - $this->timezone = $timezone ?? new DateTimeZone(date_default_timezone_get()); + $this->timezone = $timezone; } public static function fromUTC(): self diff --git a/test/SystemClockTest.php b/test/SystemClockTest.php index c5bc5c5a..e018ed5f 100644 --- a/test/SystemClockTest.php +++ b/test/SystemClockTest.php @@ -12,16 +12,6 @@ /** @coversDefaultClass \Lcobucci\Clock\SystemClock */ final class SystemClockTest extends TestCase { - /** - * @test - * - * @covers ::__construct - */ - public function constructShouldUseSystemDefaultTimezoneIfNoneWasProvided(): void - { - self::assertEquals(new SystemClock(new DateTimeZone(date_default_timezone_get())), new SystemClock()); - } - /** * @test *