Skip to content

Instantly share code, notes, and snippets.

@tonydub
Created August 27, 2018 21:03
Show Gist options
  • Save tonydub/dc33c1e44a4bc4f249c3d23ca8ccfa9d to your computer and use it in GitHub Desktop.
Save tonydub/dc33c1e44a4bc4f249c3d23ca8ccfa9d to your computer and use it in GitHub Desktop.
<?php
interface ClockInterface
{
public function currentTime(): DateTimeImmutable;
}
<?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