src/values/Value.php
public static function parse($value){
		if(preg_match(Name::PATTERN, $value)) return new Name($value);
		if(preg_match(Text::PATTERN, $value)) return new Text($value);
		if(preg_match(Color::PATTERN, $value)) return new Color($value);
		if(preg_match(Measurement::PATTERN, $value)) return new Measurement($value);
		
		throw new \Exception("Invalid Value '$value'");
	}
public static function parse($value){
		if(preg_match(Name::PATTERN, $value)) return new Name($value);
		if(preg_match(Text::PATTERN, $value)) return new Text($value);
		if(preg_match(Color::PATTERN, $value)) return new Color($value);
		if(preg_match(Measurement::PATTERN, $value)) return new Measurement($value);
		
		throw new \Exception("Invalid Value '$value'");
	}
public static function parse ( $ value ) { if ( preg_match ( Name :: PATTERN , $ value ) ) return new Name ( $ value ) ; if ( preg_match ( Text :: PATTERN , $ value ) ) return new Text ( $ value ) ; if ( preg_match ( Color :: PATTERN , $ value ) ) return new Color ( $ value ) ; if ( preg_match ( Measurement :: PATTERN , $ value ) ) return new Measurement ( $ value ) ; throw new \ Exception ( "Invalid Value '$value'" ) ; }
Parses a string into the correct value
@param unknown $value
@throws \Exception
@return \csslib\values\Value
Parses a string into the correct value