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
コード例 #1
0
ファイル: TypeAnalysisTest.php プロジェクト: timetoogo/pinq
 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());
     }
 }
コード例 #2
0
 protected final function getValue(O\Expression $expression)
 {
     return $expression->evaluate($this->evaluationContext);
 }