protected final function getOptionalArgumentAt($index, O\MethodCallExpression $methodExpression) { $argumentExpressions = $methodExpression->getArguments(); if (isset($argumentExpressions[$index])) { if ($argumentExpressions[$index]->isUnpacked()) { throw new PinqException('Cannot get argument from method call %s at index %d: argument unpacking is not supported', $methodExpression->getName()->compileDebug(), $index); } return $argumentExpressions[$index]->getValue(); } else { return null; } }
public function visitMethodCall(O\MethodCallExpression $expression) { $this->walk($expression->getValue()); $this->walk($expression->getName()); $this->walkAll($expression->getArguments()); $this->addTypeOperation($expression, $this->analysis[$expression->getValue()]->getMethod($expression)); }