Permalink
Browse files

[UPDATE] We ensure ourselves that class attribute is not already defined

[UPDATE] We ensure ourselves that class attribute is not already defined
  • Loading branch information...
mikaelcom committed Oct 31, 2012
1 parent 003f6c0 commit 4fd99ed710271470795a9f1205f74c5bd975de2e
Showing with 13 additions and 4 deletions.
  1. +13 −4 WsdlToPhp.php
@@ -1265,10 +1265,19 @@ private function addStruct($_paramType,$_paramName,$_structName)
if(!array_key_exists($structNameCleaned,$this->structs))
$this->structs[$structNameCleaned] = array();
if(!empty($_paramType) && !empty($paramNameCleaned))
$this->structs[$structNameCleaned][] = array(
'type'=>$_paramType,
'name'=>$paramNameCleaned,
'meta'=>array());
{
/**
* Ensure class attribute isn't already defined
*/
$paramExists = false;
foreach($this->structs[$structNameCleaned] as $index=>$structParam)
$paramExists |= (is_array($structParam) && array_key_exists('name',$structParam) && $structParam['name'] === $paramNameCleaned);
if(!$paramExists)
$this->structs[$structNameCleaned][] = array(
'type'=>$_paramType,
'name'=>$paramNameCleaned,
'meta'=>array());
}
}
/**
* Method to add info value to an existing struct and param

0 comments on commit 4fd99ed

Please sign in to comment.