protected final function visitOffsetSet(O\Expression $expression)
{
if ($expression instanceof O\MethodCallExpression) {
$index = $this->getArgumentValueAt(0, $expression);
$value = $this->getArgumentValueAt(1, $expression);
$sourceExpression = $expression;
} elseif ($expression instanceof O\AssignmentExpression) {
$sourceExpression = $expression->getAssignTo();
if ($sourceExpression instanceof O\IndexExpression) {
$index = $this->getValue($sourceExpression->getIndex());
$value = $this->getValue($expression->getAssignmentValue());
} else {
throw new PinqException('Cannot interpret set index operation: invalid source expression type, expecting %s, %s given', O\IndexExpression::getType(), $expression->getType());
}
} else {
throw new PinqException('Cannot interpret set index operation: invalid expression type, expecting %s, %s given', O\MethodCallExpression::getType() . ' or ' . O\AssignmentExpression::getType(), $expression->getType());
}
$this->interpretation->interpretOffsetSet($this->getId('offset-set'), $this->getId('set-index'), $index, $this->getId('set-value'), $value);
$this->interpretSourceAsScope($sourceExpression);
}