From 1b4e262c608ae97bb30d8e77a0a50ab00a6d7248 Mon Sep 17 00:00:00 2001 From: Francis Besset Date: Sun, 8 Dec 2013 00:25:20 +0100 Subject: [PATCH] [SoapBundle] Simplified conditional statement --- .../ServiceBinding/RpcLiteralRequestMessageBinder.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/BeSimple/SoapBundle/ServiceBinding/RpcLiteralRequestMessageBinder.php b/src/BeSimple/SoapBundle/ServiceBinding/RpcLiteralRequestMessageBinder.php index efba52b..13abf08 100644 --- a/src/BeSimple/SoapBundle/ServiceBinding/RpcLiteralRequestMessageBinder.php +++ b/src/BeSimple/SoapBundle/ServiceBinding/RpcLiteralRequestMessageBinder.php @@ -112,9 +112,8 @@ class RpcLiteralRequestMessageBinder implements MessageBinderInterface $value = $this->processType($type->getType(), $value); $messageBinder->writeProperty($property, $value); - } - - if (!$type->isNillable() && null === $value) { + } elseif (!$type->isNillable()) { + // @TODO use xmlType instead of phpType throw new \SoapFault('SOAP_ERROR_COMPLEX_TYPE', sprintf('"%s:%s" cannot be null.', ucfirst($phpType), $type->getName())); } }