Pinq\Expressions\Expression::functionCall PHP Method

functionCall() final public static method

final public static functionCall ( Expression $name, array $arguments = [] ) : FunctionCallExpression
$name Expression
$arguments array
return FunctionCallExpression
    public static final function functionCall(Expression $name, array $arguments = [])
    {
        return new FunctionCallExpression($name, $arguments);
    }

Usage Example

コード例 #1
0
ファイル: FunctionTest.php プロジェクト: timetoogo/pinq
 public function testFunctionWithReturnStatement()
 {
     $function = $this->functionWithReturnStatement();
     $this->assertSame('', $function->getCallableId());
     $this->assertSame(1, $function->getParameters()->count());
     $this->assertEquals([O\Expression::parameter('foo')], $function->getParameters()->getAll());
     $this->assertEquals(['param' => 'scope'], $function->getParameterScopedVariableMap());
     $this->assertEquals(['', 'param'], $function->getParameterIds());
     $this->assertSame(true, $function->hasScopeType());
     $this->assertSame(__CLASS__, $function->getScopeType());
     $this->assertSame(true, $function->hasNamespace());
     $this->assertSame(__NAMESPACE__, $function->getNamespace());
     $this->assertSame(4, $function->countBodyExpressions());
     $this->assertSame(2, $function->countBodyExpressionsUntilReturn());
     $this->assertEquals([O\Expression::value('before'), O\Expression::returnExpression(O\Expression::value('return')), O\Expression::value('after'), O\Expression::functionCall(O\Expression::value('boom'))], $function->getBodyExpressions());
     $this->assertEquals([O\Expression::value('before'), O\Expression::returnExpression(O\Expression::value('return'))], $function->getBodyExpressionsUntilReturn());
     $this->assertEquals(new O\EvaluationContext(__NAMESPACE__, __CLASS__, null, ['scope' => 'value']), $function->getEvaluationContextFactory()->getEvaluationContext(new ResolvedParameterRegistry(['param' => 'value'])));
 }
All Usage Examples Of Pinq\Expressions\Expression::functionCall