Fixed issue #8

This commit is contained in:
Francis Besset 2011-09-08 20:42:09 +02:00
parent e9864b1d02
commit ade1584448
1 changed files with 4 additions and 2 deletions

View File

@ -79,12 +79,14 @@ class RpcLiteralResponseMessageBinder implements MessageBinderInterface
$p = $r->getProperty($type->getName()); $p = $r->getProperty($type->getName());
if ($p->isPublic()) { if ($p->isPublic()) {
$value = $message->{$type->getName()}; $value = $message->{$type->getName()};
$message->{$type->getName()} = $this->processType($type->getValue(), $value);
} else { } else {
$p->setAccessible(true); $p->setAccessible(true);
$value = $p->getValue($message); $value = $p->getValue($message);
}
$value = $this->processType($type->getValue(), $value); $p->setValue($message, $this->processType($type->getValue(), $value));
}
if (!$type->isNillable() && null === $value) { if (!$type->isNillable() && null === $value) {
throw new \InvalidArgumentException(sprintf('"%s::%s" cannot be null.', $class, $type->getName())); throw new \InvalidArgumentException(sprintf('"%s::%s" cannot be null.', $class, $type->getName()));