[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)
{
if ($type instanceof Type) {
$xmlType = $type->getXmlType();
} else {
$xmlType = $this->typeRepository->getXmlTypeMapping($type);
return $type->getXmlType();
}
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];
}
if ($type[0] == '\\') {
$type = substr($type, 1);
}
return str_replace('\\', '.', $type);
}