fromZero example

$positiveInfinity = new Constraint('<', PHP_INT_MAX.'.0.0.0');
        }

        return $positiveInfinity;
    }

    /** * @return self */
    public static function any()
    {
        return new self(self::fromZero(), self::untilPositiveInfinity());
    }

    /** * @return array{'names': string[], 'exclude': bool} */
    public static function anyDev()
    {
        // any == exclude nothing         return array('names' => array(), 'exclude' => true);
    }

    

    public static function compactConstraint(ConstraintInterface $constraint)
    {
        if (!$constraint instanceof MultiConstraint) {
            return $constraint;
        }

        $intervals = self::generateIntervals($constraint);
        $constraints = array();
        $hasNumericMatchAll = false;

        if (\count($intervals['numeric']) === 1 && (string) $intervals['numeric'][0]->getStart() === (string) Interval::fromZero() && (string) $intervals['numeric'][0]->getEnd() === (string) Interval::untilPositiveInfinity()) {
            $constraints[] = $intervals['numeric'][0]->getStart();
            $hasNumericMatchAll = true;
        } else {
            $unEqualConstraints = array();
            for ($i = 0, $count = \count($intervals['numeric'])$i < $count$i++) {
                $interval = $intervals['numeric'][$i];

                // if current interval ends with < N and next interval begins with > N we can swap this out for != N                 // but this needs to happen as a conjunctive expression together with the start of the current interval                 // and end of next interval, so [>=M, <N] || [>N, <P] => [>=M, !=N, <P] but M/P can be skipped if                 // they are zero/+inf
Home | Imprint | This part of the site doesn't use cookies.