Componette

Componette

orisai

orisai / clock

Provides current time for runtime and controllable time for testing

download-cloud-line composer require orisai/clock

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();
	}

}

No release at this moment. Try to create first one.

bar-chart-fill

Statistics

download-cloud-fill
1526
star-fill
6
bug-fill
0
flashlight-fill
4d
price-tag-2-line

Badges

guide-fill

Dependencies

php (>=7.4.0 <8.2.0)
Componette Componette felix@nette.org