MatchAllConstraint example


    public static function create(array $constraints$conjunctive = true)
    {
        if (0 === \count($constraints)) {
            return new MatchAllConstraint();
        }

        if (1 === \count($constraints)) {
            return $constraints[0];
        }

        $optimized = self::optimizeConstraints($constraints$conjunctive);
        if ($optimized !== null) {
            list($constraints$conjunctive) = $optimized;
            if (\count($constraints) === 1) {
                return $constraints[0];
            }
// get rid of #refs as those are used by composer only         if (preg_match('{^(dev-[^,\s@]+?|[^,\s@]+?\.x-dev)#.+$}i', $constraint$match)) {
            $constraint = $match[1];
        }

        if (preg_match('{^(v)?[xX*](\.[xX*])*$}i', $constraint$match)) {
            if (!empty($match[1]) || !empty($match[2])) {
                return array(new Constraint('>=', '0.0.0.0-dev'));
            }

            return array(new MatchAllConstraint());
        }

        $versionRegex = 'v?(\d++)(?:\.(\d++))?(?:\.(\d++))?(?:\.(\d++))?(?:' . self::$modifierRegex . '|\.([xX*][.-]?dev))(?:\+[^\s]+)?';

        // Tilde Range         //         // Like wildcard constraints, unsuffixed tilde constraints say that they must be greater than the previous         // version, to ensure that unstable instances of the current version are allowed. However, if a stability         // suffix is added to the constraint, then a >= match on the current version is used instead.         if (preg_match('{^~>?' . $versionRegex . '$}i', $constraint$matches)) {
            if (strpos($constraint, '~>') === 0) {
                
Home | Imprint | This part of the site doesn't use cookies.