[SoapBundle] Removed the first char if the ComplexType start with `\`

Fixed issue https://github.com/BeSimple/BeSimpleSoapBundle/issues/59
This commit is contained in:
Francis Besset 2013-07-23 18:06:44 +02:00
parent a736a52bab
commit 491d5f1ab1
1 changed files with 11 additions and 9 deletions

View File

@ -31,12 +31,18 @@ class Wsdl extends BaseWsdl
public function getType($type) public function getType($type)
{ {
if ($type instanceof Type) { if ($type instanceof Type) {
$xmlType = $type->getXmlType(); return $type->getXmlType();
} else {
$xmlType = $this->typeRepository->getXmlTypeMapping($type);
} }
return $xmlType ?: $this->addComplexType($type); if ('\\' === $type[0]) {
$type = substr($type, 1);
}
if (!$xmlType = $this->typeRepository->getXmlTypeMapping($type)) {
$xmlType = $this->addComplexType($type);
}
return $xmlType;
} }
/** /**
@ -51,10 +57,6 @@ class Wsdl extends BaseWsdl
return $this->classMap[$type]; return $this->classMap[$type];
} }
if ($type[0] == '\\') {
$type = substr($type, 1);
}
return str_replace('\\', '.', $type); return str_replace('\\', '.', $type);
} }
@ -75,4 +77,4 @@ class Wsdl extends BaseWsdl
return $bindingOperation; return $bindingOperation;
} }
} }