src/PeekAndPoke/Component/Formal/Validation/ResultsIn.php
public static function aDateAfter($other, $message = 'Invalid date', $atLeastMins = 0, $atMaxMins = null)
    {
        /**
         * @param \DateTime|LocalDate|null $value
         *
         * @return bool
         */
        $check = function ($value = null) use ($other, $atLeastMins, $atMaxMins) {

            if ($value instanceof \DateTime) {
                $value = LocalDate::raw($value);
            }

            if ($value === null || ! $value instanceof LocalDate) {
                return false;
            }

            $otherDate = $other->getValue();
            if ($otherDate instanceof \DateTime) {
                $otherDate = LocalDate::raw($otherDate);
            }

            if ($otherDate === null || ! $otherDate instanceof LocalDate) {
                return false;
            }

            return $value->isAfter($otherDate->modifyByMinutes($atLeastMins))
                   && ($atMaxMins === null || $value->isBefore($otherDate->modifyByMinutes($atMaxMins)));
        };

        return new ResultsIn\OutcomeRule($check, $message);
    }
public static function aDateAfter($other, $message = 'Invalid date', $atLeastMins = 0, $atMaxMins = null)
    {
        /**
         * @param \DateTime|LocalDate|null $value
         *
         * @return bool
         */
        $check = function ($value = null) use ($other, $atLeastMins, $atMaxMins) {

            if ($value instanceof \DateTime) {
                $value = LocalDate::raw($value);
            }

            if ($value === null || ! $value instanceof LocalDate) {
                return false;
            }

            $otherDate = $other->getValue();
            if ($otherDate instanceof \DateTime) {
                $otherDate = LocalDate::raw($otherDate);
            }

            if ($otherDate === null || ! $otherDate instanceof LocalDate) {
                return false;
            }

            return $value->isAfter($otherDate->modifyByMinutes($atLeastMins))
                   && ($atMaxMins === null || $value->isBefore($otherDate->modifyByMinutes($atMaxMins)));
        };

        return new ResultsIn\OutcomeRule($check, $message);
    }
public static function aDateAfter ( $ other , $ message = 'Invalid date' , $ atLeastMins = 0 , $ atMaxMins = null ) { /**
         * @param \DateTime|LocalDate|null $value
         *
         * @return bool
         */ $ check = function ( $ value = null ) use ( $ other , $ atLeastMins , $ atMaxMins ) { if ( $ value instanceof \ DateTime ) { $ value = LocalDate :: raw ( $ value ) ; } if ( $ value === null || ! $ value instanceof LocalDate ) { return false ; } $ otherDate = $ other -> getValue ( ) ; if ( $ otherDate instanceof \ DateTime ) { $ otherDate = LocalDate :: raw ( $ otherDate ) ; } if ( $ otherDate === null || ! $ otherDate instanceof LocalDate ) { return false ; } return $ value -> isAfter ( $ otherDate -> modifyByMinutes ( $ atLeastMins ) ) && ( $ atMaxMins === null || $ value -> isBefore ( $ otherDate -> modifyByMinutes ( $ atMaxMins ) ) ) ; } ; return new ResultsIn \ OutcomeRule ( $ check , $ message ) ; }
@param ValueHolder $other
@param string      $message
@param int         $atLeastMins
@param int         $atMaxMins

@return OutcomeRule
@param ValueHolder $other @param string $message @param int $atLeastMins @param int $atMaxMins