Skip to content

Commit

Permalink
Clock: Introduce PSR-20 Clock Service
Browse files Browse the repository at this point in the history
  • Loading branch information
mjansenDatabay committed Mar 8, 2022
1 parent d378658 commit cfdbe58
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/Data/Clock/ClockFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,13 @@

namespace ILIAS\Data\Clock;

use DateTimeZone;

interface ClockFactory
{
public function system() : ClockInterface;

public function utc() : ClockInterface;

public function local(\DateTimeZone $time_zone) : ClockInterface;
public function local(DateTimeZone $time_zone) : ClockInterface;
}
4 changes: 3 additions & 1 deletion src/Data/Clock/ClockFactoryImpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@

namespace ILIAS\Data\Clock;

use DateTimeZone;

class ClockFactoryImpl implements ClockFactory
{
/**
Expand All @@ -37,7 +39,7 @@ public function utc() : ClockInterface
/**
* @inheritDoc
*/
public function local(\DateTimeZone $time_zone) : ClockInterface
public function local(DateTimeZone $time_zone) : ClockInterface
{
return new LocalClock($time_zone);
}
Expand Down

0 comments on commit cfdbe58

Please sign in to comment.