PHP code example of stella-maris / clock

1. Go to this page and download the library: Download stella-maris/clock library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

stella-maris / clock example snippets


use StellaMaris/Clock/CLockInterface;

final class PastChecker
{
    public function __construct(private ClockInterface $clock) {}
    
    public function hasDateTimeAlreadyPassed(DateTimeImmutable $item): bool
    {
        return $item < $this->clock->now();
    }
}