Created
August 27, 2018 21:03
-
-
Save tonydub/dc33c1e44a4bc4f249c3d23ca8ccfa9d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
interface ClockInterface | |
{ | |
public function currentTime(): DateTimeImmutable; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
final class SystemClock implements Clock | |
{ | |
public function currentTime(): DateTimeImmutable | |
{ | |
return new DateTimeImmutable('now'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment