Skip to content
This repository has been archived by the owner on Jun 19, 2019. It is now read-only.

Commit

Permalink
Merge branch 'feature/issue_35' into develop, fix #35 issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Mikael DELSOL committed Apr 26, 2015
2 parents a1570da + 5f781fe commit 09ae48d
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 12 deletions.
1 change: 1 addition & 0 deletions .gitignore
@@ -1,3 +1,4 @@
/.settings
/.buildpath
/.project
samples/*
21 changes: 12 additions & 9 deletions WsdlToPhpGenerator.php 100644 → 100755
Expand Up @@ -1166,7 +1166,7 @@ private function generateClassMap($_rootDirectory)
$filename);
}
/**
* Generates autoload file for all classes.
* Generates autoload file for all classes.
* The classes are loaded automatically in order of their dependency regarding their inheritance (defined in WsdlToPhpGenerate::generateStructsClasses() method).
* @uses WsdlToPhpGenerator::getPackageName()
* @uses WsdlToPhpGenerator::getOptionAddComments()
Expand Down Expand Up @@ -1667,7 +1667,9 @@ private function addService($_functionName,$_functionParameter,$_functionReturn)
elseif($serviceFunction->getParameterType() != $_functionParameter)
{
$serviceFunction->setIsUnique(false);
$this->getService($serviceName)->addFunction($_functionName,$_functionParameter,$_functionReturn,false);
$sameServiceFunction = $this->getServiceFunction($_functionName,$_functionParameter,$_functionReturn);
if($sameServiceFunction === null)
$this->getService($serviceName)->addFunction($_functionName,$_functionParameter,$_functionReturn,false);
}
}
/**
Expand All @@ -1685,12 +1687,13 @@ public function getService($_serviceName)
* @uses WsdlToPhpGenerator::getService()
* @uses WsdlToPhpService::getFunction()
* @param string $_functionName the original function name
* @param mixed $_functionParameter the original function paramter
* @param string $_functionParameter the original parameter name
* @param string $_functionReturn the original return name
* @return WsdlToPhpFunction|null
*/
private function getServiceFunction($_functionName)
private function getServiceFunction($_functionName,$_functionParameter = null,$_functionReturn = null)
{
return $this->getService($this->getServiceName($_functionName))?$this->getService($this->getServiceName($_functionName))->getFunction($_functionName):null;
return $this->getService($this->getServiceName($_functionName))?$this->getService($this->getServiceName($_functionName))->getFunction($_functionName,$_functionParameter,$_functionReturn):null;
}
/**
* Sets the service function documentation
Expand Down Expand Up @@ -2101,11 +2104,11 @@ protected function wsdlsLoaded()
*/
array_push($tags,'attribute');
/**
* Retrieve operation message types in order to fully determine themselves
* Retrieve operation message types in order to fully determine themselves
*/
array_push($tags,'input');
/**
* Retrieve operation message types in order to fully determine themselves
* Retrieve operation message types in order to fully determine themselves
*/
array_push($tags,'output');
foreach($tags as $tagName)
Expand Down Expand Up @@ -3480,7 +3483,7 @@ private static function getGlobal($_globalKey,$_globalFallback = null)
* @uses WsdlToPhpGenerator::getGlobal()
* @uses WsdlToPhpGenerator::setGlobal()
* @uses WsdlToPhpGenerator::getOptionDebug()
* @param string $_auditName the type of audit (parsing, generating, etc..). If audit name is parsing_DOM, than parsing is created to cumulate time for all parsing processes
* @param string $_auditName the type of audit (parsing, generating, etc..). If audit name is parsing_DOM, than parsing is created to cumulate time for all parsing processes
* @param string $_auditElement audit specific element
* @param int $_spentTime already spent time on the current audit category (and element)
* @param bool $_createOnly indicates if the element must be only created or not
Expand Down Expand Up @@ -3571,7 +3574,7 @@ private static function audit($_auditName,$_auditElement = '',$_spentTime = 0,$_
/**
* Method to initialize audit for an element
* @uses WsdlToPhpGenerator::audit()
* @param string $_auditName the type of audit (parsing, generating, etc..). If audit name is parsing_DOM, than parsing is created to cumulate time for all parsing processes
* @param string $_auditName the type of audit (parsing, generating, etc..). If audit name is parsing_DOM, than parsing is created to cumulate time for all parsing processes
* @param string $_auditElement audit specific element
* @return bool true
*/
Expand Down
8 changes: 5 additions & 3 deletions WsdlToPhpService.php 100644 → 100755
Expand Up @@ -195,7 +195,7 @@ public function getClassBody(&$_body)
}
/**
* Returns the functions of the service
* @return array
* @return array[WsdlToPhpFunction]
*/
public function getFunctions()
{
Expand Down Expand Up @@ -231,13 +231,15 @@ public function addFunction($_functionName,$_functionParameterType,$_functionRet
* @uses WsdlToPhpService::getFunctions()
* @uses WsdlToPhpModel::getName()
* @param string $_functionName the original function name
* @param string $_functionParameter the original parameter name
* @param string $_functionReturn the original return name
* @return WsdlToPhpFunction|null
*/
public function getFunction($_functionName)
public function getFunction($_functionName,$_functionParameter = null,$_functionReturn = null)
{
foreach($this->getFunctions() as $function)
{
if($function->getName() === $_functionName)
if($function->getName() === $_functionName && ($_functionParameter === null || $function->getParameterType() === $_functionParameter) && ($_functionReturn === null || $function->getReturnType() === $_functionReturn))
return $function;
}
return null;
Expand Down

0 comments on commit 09ae48d

Please sign in to comment.