protected static function splitConstraints($version)
    {
        $found   = [];
        $pattern = '/(?<!^|as|[=>< ,]) *(?<!-)[, ](?!-) *(?!,|as|$)/';

        foreach (preg_split('/\s*\|\|?\s*/', trim($version)) as $constraints) {
            $andConstraints = preg_split($pattern, $constraints);

            foreach ($andConstraints as $constraint) {
                $found[] = $constraint;
            }
        }

        return $found;
    }
protected static function splitConstraints($version)
    {
        $found   = [];
        $pattern = '/(?<!^|as|[=>< ,]) *(?<!-)[, ](?!-) *(?!,|as|$)/';

        foreach (preg_split('/\s*\|\|?\s*/', trim($version)) as $constraints) {
            $andConstraints = preg_split($pattern, $constraints);

            foreach ($andConstraints as $constraint) {
                $found[] = $constraint;
            }
        }

        return $found;
    }
protected static function splitConstraints ( $ version ) { $ found = [ ] ; $ pattern = '/(?<!^|as|[=>< ,]) *(?<!-)[, ](?!-) *(?!,|as|$)/' ; foreach ( preg_split ( '/\s*\|\|?\s*/' , trim ( $ version ) ) as $ constraints ) { $ andConstraints = preg_split ( $ pattern , $ constraints ) ; foreach ( $ andConstraints as $ constraint ) { $ found [ ] = $ constraint ; } } return $ found ; }
Split a version specification into a list of version constraints.

@param  string  $version

@return array
Split a version specification into a list of version constraints .