/* (non-PHPdoc)
@see \CrudGenerator\Generators\Parser\Lexical\ParserInterface::evaluate()
515118
public function isValid(
        array $expressions,
        GeneratorDataObject $generator,
        PhpStringParser $phpStringParser
    ) {
        foreach ($expressions as $expression) {
            try {
                $comparaisonDifferentEquals = $this->analyseExpressionType(
                    $expression,
                    ConditionInterface::DIFFERENT_EQUAL
                );
                $addEnvironnementExpression = (
                    $comparaisonDifferentEquals['environnementValue'] !==
                    $generator->getEnvironnement($comparaisonDifferentEquals['environnementName'])
                );
            } catch (\InvalidArgumentException $e) {
                $comparaisonEquals          = $this->analyseExpressionType($expression, ConditionInterface::EQUAL);
                $addEnvironnementExpression = (
                    $comparaisonEquals['environnementValue'] ===
                    $generator->getEnvironnement($comparaisonEquals['environnementName'])
                );
            }

            if ($addEnvironnementExpression === false) {
                return false;
            }
        }

        return true;
    }
1153594
public Object evaluate(Object pContext,
                           VariableResolver pResolver,
                           Map functions,
                           String defaultPrefix,
                           Logger pLogger)
            throws ELException {
        return mValue;
    }
4451
public function evaluateExpression($expression)
    {
        if ($this->getTalesMode() === 'php') {
            return PHPTAL_Php_TalesInternal::php($expression);
        }
        return PHPTAL_Php_TalesInternal::compileToPHPExpressions($expression, false);
    }
704738
public function evaluate()
    {
        $currentContext = $this->runtime->getCurrentContext();
        $this->pluginViewNode = $currentContext['node'];
        /** @var $parentResponse Response */
        $parentResponse = $this->runtime->getControllerContext()->getResponse();
        $pluginResponse = new ActionResponse($parentResponse);

        $pluginRequest = $this->buildPluginRequest();
        if ($pluginRequest->getControllerObjectName() === '') {
            $message = 'Master View not selected';
            if ($this->pluginViewNode->getProperty('plugin')) {
                $message = 'Plugin View not selected';
            }
            if ($this->pluginViewNode->getProperty('view')) {
                $message ='Master View or Plugin View not found';
            }
            return $this->pluginViewNode->getContext()->getWorkspaceName() !== 'live' || $this->objectManager->getContext()->isDevelopment() ? '<p>' . $message . '</p>' : '<!-- ' . $message . '-->';
        }
        $this->dispatcher->dispatch($pluginRequest, $pluginResponse);
        return $pluginResponse->getContent();
    }
599009
public function evaluate(array $values, Context $context, Token $token)
    {
        if (count($values) !== $this->getOperands()) {
            throw new ExpressionException('Invalid number of operands for operator.',
              $this, $values);
        }
        $evaluator = $this->evaluator;
        return (string)$evaluator($values, $context, $token);
    }
1332599
public function evaluate($values)
    {
        $returnValue = PasswordConstraintsService::singleton()->validate($values);

        if( !$returnValue && !$this->hasOption('message') ){
            $this->setMessage(implode( ', ', PasswordConstraintsService::singleton()->getErrors()));
        }

        return (bool) $returnValue;
    }
862339
public function evaluate()
    {
        if ($this->stack->hasMessage() && $this->isEnabled()) {
            $this->getRuntime()->setEnableContentCache(false);
            return $this->stack->dump();
        }
        return $this->fusionValue('value');
    }
287188
public function evaluate()
    {
        $asset = $this->getAsset();
        $preset = $this->getPreset();

        if (!$asset instanceof AssetInterface) {
            throw new \Exception('No asset given for rendering.', 1415184217);
        }
        if (!empty($preset)) {
            $thumbnailConfiguration = $this->thumbnailService->getThumbnailConfigurationForPreset($preset);
        } else {
            $thumbnailConfiguration = new ThumbnailConfiguration($this->getWidth(), $this->getMaximumWidth(), $this->getHeight(), $this->getMaximumHeight(), $this->getAllowCropping(), $this->getAllowUpScaling(), $this->getAsync(), $this->getQuality(), $this->getFormat());
        }
        $request = $this->getRuntime()->getControllerContext()->getRequest();
        $thumbnailData = $this->assetService->getThumbnailUriAndSizeForAsset($asset, $thumbnailConfiguration, $request);
        if ($thumbnailData === null) {
            return '';
        }
        return $thumbnailData['src'];
    }
149499
protected function evaluate($expr, DOMNode $node = null)
	{
		return (isset($node)) ? $this->xpath->evaluate($expr, $node) : $this->xpath->evaluate($expr);
	}
1021185
def do_evaluate(parser, token):
  ''''''
  code = token.contents
  firstspace = code.find(' ')
  if firstspace >= 0:
    code = code[firstspace+1:]
  return Evaluator(code)
152909
public function evaluate($value) {
		switch ($this->comparison) {
			case '':
			case '=':
				foreach ($this->value as $value_item) {
					if ($value_item == $value) {
						return true;
					}
				}
				return false;
			case '!=':
			case '<>':
				foreach ($this->value as $value_item) {
					if ($value_item != $value) {
						return true;
					}
				}
				return false;
			case '<':
				foreach ($this->value as $value_item) {
					if ($value_item < $value) {
						return true;
					}
				}
				return false;
			case '>':
				foreach ($this->value as $value_item) {
					if ($value_item > $value) {
						return true;
					}
				}
				return false;
			case '<=':
				foreach ($this->value as $value_item) {
					if ($value_item <= $value) {
						return true;
					}
				}
				return false;
			case '>=':
				foreach ($this->value as $value_item) {
					if ($value_item >= $value) {
						return true;
					}
				}
				return false;
			default:
				throw new \Exception("Unsupported comparison operator: '" . $this->comparison . "'");
		}
	}
1030641
public function evaluate(array $process, PhpStringParser $parser, GeneratorDataObject $generator, $firstIteration)
    {
        if (isset($process['templateVariables']) === true) {
            foreach ($process['templateVariables'] as $variable) {
                if (is_array($variable) === false) {
                    throw new MalformedGeneratorException(
                        sprintf('Variable excepts to be an array "%s" given', gettype($variable))
                    );
                }
                if ($this->conditionValidator->isValid($variable, $generator, $parser) === true) {
                    $this->evaluateVariable($variable, $parser, $generator, (bool) $firstIteration);
                }
            }
        }

        return $generator;
    }
867806
public function evaluate($expression, Context $context)
    {
        $expression = trim($expression);
        $identifier = md5($expression);
        $functionName = 'expression_' . $identifier;
        if (isset($this->evaluatedExpressions[$functionName])) {
            return $this->evaluateAndUnwrap($this->evaluatedExpressions[$functionName], $context);
        }

        $functionDeclaration = $this->expressionCache->get($functionName);
        if (!$functionDeclaration) {
            $functionDeclaration = $this->generateEvaluatorCode($expression);
            $this->expressionCache->set($functionName, $functionDeclaration);
        }

        $expressionFunction = eval($functionDeclaration);
        $this->evaluatedExpressions[$functionName] = $expressionFunction;
        return $this->evaluateAndUnwrap($expressionFunction, $context);
    }
1137051
public function evaluate($variable = array())
    {
        
        common_Logger::i('Evaluating Operation uri : '. $this->getUri(), array('Generis Operation'));
        common_Logger::i('Evaluating Operation name : '. $this->getLabel(), array('Generis Operation'));
        
        $operator = $this->getOperator();
        common_Logger::d('Operator uri: '. $operator->getUri(), array('Generis Operation'));
        common_Logger::d('Operator name: '. $operator->getLabel(), array('Generis Operation'));         

	    $firstPart = $this->getFirstOperation()->evaluate($variable);
	    $secondPart = $this->getSecondOperation()->evaluate($variable);


		if($firstPart instanceof core_kernel_classes_ContainerCollection ) {
			//if we have more than one result we only take the Literal label
			$nbLiteral = 0;
			$iterator = $firstPart->getIterator();
			foreach ($iterator as $first) {
				if ($first instanceof core_kernel_classes_Literal ) {
					$firstPart = $first;
					$nbLiteral++;
				}
				
			}
			if ($nbLiteral != 1){
				var_dump($iterator);
				throw new common_Exception('more than one Literal Retreive during  evaluation');
			}
    	}


   		
    	if($secondPart instanceof core_kernel_classes_ContainerCollection ) {
    		//if we have more than one result we only take the resource label
			$nbLiteral = 0;
			$iterator = $secondPart->getIterator();
			foreach ($secondPart->getIterator() as $second) {
				if ($second instanceof core_kernel_classes_Literal) {
					$secondPart = $second;
					$nbLiteral++;
				}

			}
			if ($nbLiteral != 1){
				var_dump($iterator);
				throw new common_Exception('more than one Literal Retreive during evaluation');
			}
    	}

    	common_Logger::d('First Part : ', array('Generis Operation'));
    	common_Logger::d('Second Part : '. $secondPart, array('Generis Operation'));
    	$returnValue = $this->evaluateRecursiveOperation($firstPart,$secondPart,$operator);
    	common_Logger::i('Operation value: '. $returnValue, array('Generis Operation'));
    	
    	return $returnValue;
        
    }
1067411
public function evaluate($expression, $values = [])
    {
        return $this->parse($expression, array_keys($values))->getNodes()->evaluate($this->functions, $values);
    }
1112237
public function evaluate(Context $context)
    {
        /** @var VariableOperand $left */
        /** @var VariableOperand $right */
        list($left, $right) = $this->getOperands();

        $left = $left->prepareValue($context);

        if (is_array($left->getValue())) {
            trigger_error('Contains operator is deprecated, please use SetContains', E_USER_DEPRECATED);

            return $left->getSet()->setContains($right->prepareValue($context));
        } else {
            trigger_error('Contains operator is deprecated, please use StringContains', E_USER_DEPRECATED);

            return $left->stringContains($right->prepareValue($context));
        }
    }
1239998
public function evaluate(array $process, PhpStringParser $parser, GeneratorDataObject $generator, $firstIteration)
    {
        $skeletonPath = $generator->getPath() . '/Skeleton/';

        if (false === $this->fileManager->isDir($skeletonPath)) {
            throw new MalformedGeneratorException(
                sprintf('The Skeleton path "%s" is not a valid directory', $skeletonPath)
            );
        }

        if (false === isset($process['filesList']) || false === is_array($process['filesList'])) {
            throw new MalformedGeneratorException('No file given');
        }

        foreach ($process['filesList'] as $file) {
            $file = $this->checkIsFileIsWellFormed($file, $skeletonPath);

            if ($this->conditionValidator->isValid($file, $generator, $parser) === true) {
                $generator = $this->evaluateFile($file, $parser, $generator, $skeletonPath);
            }
        }

        return $generator;
    }