public static function fromCompareString( $component, $comparisonString ) {

		$matcher = '`
			(
				>=?     # Matches >= and >.
				|
				<=?     # Matches <= and <.
			)
			([^>=<\s]+) # Matches anything except >, <, =, and whitespace.
		`x';

		if ( ! preg_match( $matcher, $comparisonString, $match ) ) {
			throw new Whip_InvalidVersionComparisonString( $comparisonString );
		}

		$version  = $match[2];
		$operator = $match[1];

		return new Whip_VersionRequirement( $component, $version, $operator );
	}
public static function fromCompareString( $component, $comparisonString ) {

		$matcher = '`
			(
				>=?     # Matches >= and >.
				|
				<=?     # Matches <= and <.
			)
			([^>=<\s]+) # Matches anything except >, <, =, and whitespace.
		`x';

		if ( ! preg_match( $matcher, $comparisonString, $match ) ) {
			throw new Whip_InvalidVersionComparisonString( $comparisonString );
		}

		$version  = $match[2];
		$operator = $match[1];

		return new Whip_VersionRequirement( $component, $version, $operator );
	}
public static function fromCompareString ( $ component , $ comparisonString ) { $ matcher = '`
			(
				>=?     # Matches >= and >.
				|
				<=?     # Matches <= and <.
			)
			([^>=<\s]+) # Matches anything except >, <, =, and whitespace.
		`x' ; if ( ! preg_match ( $ matcher , $ comparisonString , $ match ) ) { throw new Whip_InvalidVersionComparisonString ( $ comparisonString ) ; } $ version = $ match [ 2 ] ; $ operator = $ match [ 1 ] ; return new Whip_VersionRequirement ( $ component , $ version , $ operator ) ; }
Creates a new version requirement from a comparison string.

@throws Whip_InvalidVersionComparisonString When an invalid version comparison string is passed.

@param string $component        The component for this version requirement.
@param string $comparisonString The comparison string for this version requirement.

@returns Whip_VersionRequirement The parsed version requirement.
Creates a new version requirement from a comparison string .