(non-PHPdoc)
@see tao_helpers_form_Validator::evaluate()
766642
public function evaluate($values)
    {
        $returnValue = (bool) false;

        
		$value = trim($values);
		
		try{
			$dateTime = new DateTime($value);
			
    		// if no date given no need to go further. To check if not empty, use the NotEmpty validator
			if(!empty($value) && !empty($this->getOption('comparator')) && $this->getOption('datetime2_ref') instanceof tao_helpers_form_FormElement){
                
			    //try comparison:
				try{
					$dateTime2 = new DateTime($this->getOption('datetime2_ref')->getRawValue());
				}catch(Exception $e){}
				
				if($dateTime2 instanceof DateTimeInterface){
					
					switch ($this->getOption('comparator')){
						case 'after':
						case 'later':
						case 'sup':
						case '>':{
							if ($dateTime > $dateTime2) {
                                    $returnValue = true;
							} else {
							    $this->setMessage(__('Invalid date range (must be after: %s)',$dateTime2->format('Y-m-d')));
							}
							break;
						}
                        case '>=':{
                            if ($dateTime >= $dateTime2) {
                                $returnValue = true;
                            } else {
                                $this->setMessage(__('Invalid date range (must be after or the same as: %s)',$dateTime2->format('Y-m-d')));
                            }
                            break;
                        }
						case 'before':
						case 'earlier':
						case 'inf':
						case '<':{
							if ($dateTime < $dateTime2) {
								$returnValue = true;
							} else {
							    $this->setMessage(__('Invalid date range (must be before: %s)',$dateTime2->format('Y-m-d')));
							}
							break;
						}
                        case '<=':{
                            if ($dateTime <= $dateTime2) {
                                $returnValue = true;
                            } else {
                                $this->setMessage(__('Invalid date range (must be before or the same as: %s)',$dateTime2->format('Y-m-d')));
                            }
                            break;
                        }
						default:
							throw new common_Exception('Usuported comparator in DateTime Validator: '.$this->getOption('comparator'));
					}
				}
			
			}else{
				$returnValue = true; 
			}
		}catch(Exception $e){
			$this->setMessage(__('The value of this field must be a valide date format, e.g. YYYY-MM-DD'));
			$returnValue = false;
		}
		
        

        return (bool) $returnValue;
    }
1369649
public function evaluate($values)
    {
        $returnValue = (bool) false;

        
        $returnValue = true;
        
		$values = is_array($values) ? $values : array($values);
		foreach ($values as $value) {
			if ($this->hasOption('min') && mb_strlen($value) < $this->getOption('min')) {
				if ($this->hasOption('allowEmpty') &&  $this->getOption('allowEmpty') && empty($value)) {
					continue;
				} else {
					$returnValue = false;
					break;
				}
			}
			if ($this->hasOption('max') && mb_strlen($value) > $this->getOption('max')) {
				$returnValue = false;
				break;
			}
		}
        

        return (bool) $returnValue;
    }
844197
public function evaluate($values)
    {
        $returnValue = (bool) false;

        
        $invert = $this->hasOption('invert') ? $this->getOption('invert') : false;
        $reference = $this->getOption('reference');
		$equals = ($values == $reference->getRawValue());
		$returnValue = $invert ? !$equals : $equals;
        

        return (bool) $returnValue;
    }
615061
public function evaluate($values)
    {
        $returnValue = (bool) false;

        
		
		if(is_array($values)){
			if(isset($values['size'])){
				if($values['size'] >= $this->getOption('min') && $values['size'] <= $this->getOption('max')){
					$returnValue = true;
				}
			}else{
				$returnValue = true;
			}
		}else{
			$returnValue = true;
		}
		
        

        return (bool) $returnValue;
    }
914626
private function evaluateAndGet($key)
    {
        $valTO = $this->evaluate($key);
        $this->setValue($key, $valTO);

        if ($valTO->fails()) {
            $this->err_num++;
        }
    }
111878
function validate($value, $key, $fields, $options, $exists, \CharlotteDunois\Validation\Validator $validator) {
        if(isset($_FILES[$key])) {
            if(!\file_exists($_FILES[$key]['tmp_name'])) {
                return 'formvalidator_make_image';
            }
            
            $size = \getimagesize($_FILES[$key]['tmp_name']);
        } else {
            if(!$exists) {
                return false;
            }
            
            $size = @\getimagesizefromstring($value);
        }
        
        if(!$size) {
            return 'formvalidator_make_image';
        }
        
        return true;
    }
342784
public function validate($value)
    {
        $validators = $this->getValidators();
        if ($validators->count() > 0) {
            $result = null;
            foreach ($validators as $validator) {
                if ($result === null) {
                    $result = $validator->validate($value);
                } else {
                    $result->merge($validator->validate($value));
                }
            }
        } else {
            $result = new ErrorResult();
        }

        return $result;
    }
890311
public function validate($value) {
        if(filter_var($value, FILTER_VALIDATE_INT)===false) {
            return new ValidationResult(false, 'Not a valid integer');
        }        
        return new ValidationResult(true);
    }
1099463
public function evaluate()
    {
        $items = parent::evaluate();
        $collection = $this->fusionValue('appendTo');

        return array_merge($collection, $items);
    }
986151
public function validate()
    {
        $report = common_report_Report::createInfo();

        foreach ($this->formProperties as $property) {

            try {
                $value = $property['formValue'];

                if (isset($property['validators'])) {
                    foreach ($property['validators'] as $validatorName) {
                        $validatorClass = 'tao_helpers_form_validators_' . $validatorName;
                        if (!class_exists($validatorClass)) {
                            throw new common_Exception('Validator is not correctly set (unknown)');
                        }
                        /** @var ValidatorInterface $validator */
                        $validator = new $validatorClass();
                        if (!$validator->evaluate($value)) {
                            throw new common_exception_ValidationFailed(
                                $property['uri'], $validator->getMessage()
                            );
                        }
                    }
                }

                if (isset($property['range'])) {
                    if (!isset($this->ranges[$property['range']])) {
                        throw new common_Exception($property['label'] . ' : Range is unknown');
                    }
                    $rangeValidated = false;
                    foreach ($this->ranges[$property['range']] as $rangeData) {

                        if (is_array($value)) {
                            foreach ($value as $k => $v) {
                                if ($rangeData['uri'] == $v) {
                                    unset($value[$k]);
                                }
                            }
                            if (empty($value)) {
                                $rangeValidated = true;
                                break;
                            }
                        } else {
                            if ($rangeData['uri'] == $value) {
                                $rangeValidated = true;
                                break;
                            }
                        }

                    }
                    if (!$rangeValidated) {
                        throw new common_exception_ValidationFailed(
                            $property['uri'], 'Range "' . $value . '" for field "' . $property['label'] . '" is not recognized.'
                        );
                    }

                }
            } catch (common_exception_ValidationFailed $e) {
                $subReport = common_report_Report::createFailure($e->getMessage());
                $subReport->setData($property['uri']);
                $report->add($subReport);
            }
        }

        return $report;
    }
1283209
public function evaluate() {
		$value = $this->tsValue('value');
		$isActive = $this->tsValue('isActive');

		$sampleData = $this->tsValue('sampleData');
		if ($isActive) {
			$value = preg_replace_callback(self::PLACEHOLDER_REGEX, function($element) use ($sampleData) {
				return ObjectAccess::getPropertyPath($sampleData, $element[1]);
			}, $value);

			return $value;
		} else {
			return $value;
		}
	}
1259170
function eval$if(params) {
  var script = params.$if
              ? params.$then
              : typeof params.$else == 'undefined' ? null : params.$else;
  return isScript(script)
          ? new this.js.Script(script)
          : script;
}
415921
protected function evalExpression()
    {
        $this->log("Evaluating PHP expression: " . $this->expression, $this->logLevel);
        if (!StringHelper::endsWith(';', trim($this->expression))) {
            $this->expression .= ';';
        }

        if ($this->returnProperty !== null) {
            $retval = null;
            eval('$retval = ' . $this->expression);
            $this->project->setProperty($this->returnProperty, $retval);
        } else {
            eval($this->expression);
        }
    }
1293831
public function evaluate()
    {
        $this->validate();
        $actual = $this->getVersion();
        if (null != $this->atLeast) {
            return version_compare($actual, $this->atLeast, '>=');
        }

        if (null != $this->exactly) {
            return version_compare($actual, $this->exactly, '=');
        }

        return false;
    }
759219
public function validate($key, $value)
    {
        $this->v_key = $key;

        $expected = static::$expected[$key];

        if (!is_array($expected)) {
            $expected = array($expected);
        }

        // if it has optional rule and theres no value
        if (in_array('optional', $expected) && ($value == '' || is_null($value))) {
            return $value;
        }

        foreach ($expected as $rule) {
            if (method_exists($this, "$rule")) {
                $value = call_user_func_array(array($this, "$rule"), array($value));

            } else {
                // Missing rule method exception
                throw new Exceptions\IncorrectValidationMethodException($rule);
            }
        }

        return $value;
    }
273592
public function evaluate()
    {
        $glue = $this->getGlue();
        $parentResult = parent::evaluate();
        if ($parentResult !== []) {
            return implode($glue, $parentResult);
        }
        return null;
    }
836590
public function evaluate($expression, $values=[]) {
        if(is_array($values)) {
            return parent::evaluate($expression, $values);
        } else {
            return $this->parse($expression, $values->getKeys())->getNodes()->evaluate($this->functions, $values);
        }
    }