Skip to content

Latest commit

 

History

History
56 lines (44 loc) · 1.76 KB

README.md

File metadata and controls

56 lines (44 loc) · 1.76 KB

Orisai
Clock

Provider of current time for runtime and controllable time for testing

PSR-20 compatible

📄 Check out our documentation.

💸 If you like Orisai, please make a donation. Thank you!

use Orisai\Clock\Clock;
use function Orisai\Clock\now;

class ExampleService
{

	private Clock $clock;

	public function __construct(Clock $clock)
	{
		$this->clock = $clock;
	}

	public function doSomething(): void
	{
		$currentTime = $this->clock->now();
		// Or
		$currentTime = now();
	}

}