Skip to content

Commit

Permalink
Always require a timezone to create the SystemClock
Browse files Browse the repository at this point in the history
  • Loading branch information
lcobucci committed Aug 27, 2020
1 parent 65091bb commit db5433a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 12 deletions.
4 changes: 2 additions & 2 deletions src/SystemClock.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 0 additions & 10 deletions test/SystemClockTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*
Expand Down

0 comments on commit db5433a

Please sign in to comment.