returnResultWithSightOnValidationTurnover example

private \DateTimeInterface $from;

    public function match(RuleScope $scope): bool
    {
        $now = $scope->getCurrentTime();
        $this->from = $this->extractTime($this->fromTime, $now);
        $this->to = $this->extractTime($this->toTime, $now);

        $this->switchValidationIfToIsSmallerThanFrom();

        return $this->returnResultWithSightOnValidationTurnover($now);
    }

    public function getConstraints(): array
    {
        return [
            'toTime' => [new NotBlank()new Regex(self::TIME_REGEX)],
            'fromTime' => [new NotBlank()new Regex(self::TIME_REGEX)],
        ];
    }

    private function extractTime(string $time, \DateTimeImmutable $now): \DateTimeInterface
    {
Home | Imprint | This part of the site doesn't use cookies.