You are here

public static function EasyRdf_Literal_Decimal::validate in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/easyrdf/easyrdf/lib/EasyRdf/Literal/Decimal.php \EasyRdf_Literal_Decimal::validate()

Parameters

string $value:

Throws

UnexpectedValueException

1 call to EasyRdf_Literal_Decimal::validate()
EasyRdf_Literal_Decimal::__construct in vendor/easyrdf/easyrdf/lib/EasyRdf/Literal/Decimal.php
Constructor for creating a new decimal literal

File

vendor/easyrdf/easyrdf/lib/EasyRdf/Literal/Decimal.php, line 92

Class

EasyRdf_Literal_Decimal
Class that represents an RDF Literal of datatype xsd:decimal

Code

public static function validate($value) {
  if (!mb_ereg_match(self::DECIMAL_REGEX, $value)) {
    throw new UnexpectedValueException("'{$value}' doesn't look like a valid decimal");
  }
}