<?php

namespace CouponsPlus\App\Conditions\BuiltIn\Conditions\Time;

use Carbon\Carbon;
use DateTimeInterface;
use CouponsPlus\App\Conditions\BuiltIn\Conditions\Time\Abilities\CheckableTime;

class MinutesChecker implements CheckableTime
{
    /**
     * @var int 0-59
     */
    protected int $minute;
    public function __construct(int $minute)
    {
        $this->minute = $minute;
    }

    public function matches(Carbon $date): bool
    {
        return $date->minute === $this->minute;
    }
}