44        $string = trim($string);
 
   45        if (!$this->case_sensitive) {
 
   47            $string = ctype_lower($string) ? $string : strtolower($string);
 
   49        $result = isset($this->valid_values[$string]);
 
   51        return $result ? $string : 
false;
 
   60    public function make($string)
 
   62        if (strlen($string) > 2 && $string[0] == 
's' && $string[1] == 
':') {
 
   63            $string = substr($string, 2);
 
   68        $values = explode(
',', $string);
 
An exception for terminatinating execution or to throw for unit testing.
Validates a keyword against a list of valid values.
$case_sensitive
Bool indicating whether or not enumeration is case sensitive.
__construct($valid_values=array(), $case_sensitive=false)
$valid_values
Lookup table of valid values.
validate($string, $config, $context)
Base class for all validating attribute definitions.