evaluate() public method

Evaluates the expression tree in the supplied context and returns the resulting value.
public evaluate ( Pinq\Expressions\IEvaluationContext $context = null ) : mixed
$context Pinq\Expressions\IEvaluationContext
return mixed
Esempio n. 1
0
 protected function assertTypeMatchesValue(ITypeAnalysis $analysis, O\Expression $expression, IType $metadataType = null)
 {
     $type = $this->typeSystem->getTypeFromValue($expression->evaluate(O\EvaluationContext::staticContext(__NAMESPACE__, __CLASS__)));
     $this->assertEqualTypes($type, $analysis->getReturnTypeOf($expression));
     if ($metadataType !== null) {
         $this->assertEqualTypes($metadataType, $type, $expression->compileDebug());
     }
 }
Esempio n. 2
0
 protected final function getValue(O\Expression $expression)
 {
     return $expression->evaluate($this->evaluationContext);
 }