Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

[UPDATE] deep refactoring and improvements

[UPDATE] deep refactoring on : php doc in generated classes, struct name
definition and identification, constant value type definition, php doc
in WsdlToPhp class, improvements on parameters naming and presence
determination
  • Loading branch information...
mikaelcom committed Nov 14, 2012
1 parent de22eab commit 1d24b34c8410b7f4bdabc012222db8c69f371338
Showing with 183 additions and 110 deletions.
  1. +60 −42 WsdlClassFileTpl.php
  2. +123 −68 WsdlToPhp.php
@@ -121,7 +121,7 @@ class PackageNameWsdlClass extends stdClass implements ArrayAccess,Iterator,Coun
* @uses PackageNameWsdlClass::initSoapClient()
* @uses PackageNameWsdlClass::initInternArrayToIterate()
* @uses PackageNameWsdlClass::_set()
* @param array values
* @param array $_arrayOfValues values
* @return Lists
*/
public function __construct($_arrayOfValues = array())
@@ -146,24 +146,28 @@ public function __construct($_arrayOfValues = array())
}
}
/**
* Static method getting current SoapClient
* @return SoapClient
*/
public static function getSoapClient()
{
return self::$soapClient;
}
/**
* @param SoapClient $soapClient
* Static method setting current SoapClient
* @param SoapClient $_soapClient
* @return SoapClient
*/
protected static function setSoapClient(SoapClient $_soapClient)
{
return (self::$soapClient = $_soapClient);
}
/**
* Init SoapClient
* Method initiating SoapClient
* @uses PackageNameWsdlClass::classMap()
* @uses PackageNameWsdlClass::getDefaultWsdlOptions()
* @param array WSDL options
* @param array $_wsdlOptions WSDL options
* @return void
*/
public function initSoapClient($_wsdlOptions)
{
@@ -188,7 +192,7 @@ public function initSoapClient($_wsdlOptions)
}
}
/**
* Returns all default options values
* Method returning all default options values
* @uses PackageNameWsdlClass::WSDL_CACHE_WSDL
* @uses PackageNameWsdlClass::WSDL_COMPRESSION
* @uses PackageNameWsdlClass::WSDL_CONNECTION_TIMEOUT
@@ -224,7 +228,7 @@ public static function getDefaultWsdlOptions()
self::WSDL_USER_AGENT=>null);
}
/**
* Alias to count
* Method alias to count
* @uses PackageNameWsdlClass::count()
* @return int
*/
@@ -243,7 +247,7 @@ public function count()
return $this->getInternArrayToIterateIsArray()?count($this->getInternArrayToIterate()):-1;
}
/**
* Returns the current element
* Method returning the current element
* @uses PackageNameWsdlClass::offsetGet()
* @return mixed
*/
@@ -252,7 +256,7 @@ public function current()
return $this->offsetGet($this->internArrayToIterateOffset);
}
/**
* Moves the current position to the next element
* Method moving the current position to the next element
* @uses PackageNameWsdlClass::getInternArrayToIterateOffset()
* @uses PackageNameWsdlClass::setInternArrayToIterateOffset()
* @return int
@@ -262,7 +266,7 @@ public function next()
return $this->setInternArrayToIterateOffset($this->getInternArrayToIterateOffset() + 1);
}
/**
* Reset itemOffset
* Method resetting itemOffset
* @uses PackageNameWsdlClass::setInternArrayToIterateOffset()
* @return int
*/
@@ -271,7 +275,7 @@ public function rewind()
return $this->setInternArrayToIterateOffset(0);
}
/**
* Check if current itemOffset points to an existing item
* Method checking if current itemOffset points to an existing item
* @uses PackageNameWsdlClass::getInternArrayToIterateOffset()
* @uses PackageNameWsdlClass::offsetExists()
* @return bool true|false
@@ -281,7 +285,7 @@ public function valid()
return $this->offsetExists($this->getInternArrayToIterateOffset());
}
/**
* Returns current itemOffset value, alias to getInternArrayToIterateOffset
* Method returning current itemOffset value, alias to getInternArrayToIterateOffset
* @uses PackageNameWsdlClass::getInternArrayToIterateOffset()
* @return int
*/
@@ -290,7 +294,7 @@ public function key()
return $this->getInternArrayToIterateOffset();
}
/**
* Alias to offsetGet
* Method alias to offsetGet
* @see PackageNameWsdlClass::offsetGet()
* @uses PackageNameWsdlClass::offsetGet()
* @param int
@@ -301,15 +305,15 @@ public function item($_index)
return $this->offsetGet($_index);
}
/**
* Default method to add item to array
* Default method adding item to array
* @uses PackageNameWsdlClass::getAttributeName()
* @uses PackageNameWsdlClass::__toString()
* @uses PackageNameWsdlClass::_set()
* @uses PackageNameWsdlClass::_get()
* @uses PackageNameWsdlClass::setInternArrayToIterate()
* @uses PackageNameWsdlClass::setInternArrayToIterateIsArray()
* @uses PackageNameWsdlClass::setInternArrayToIterateOffset()
* @param mixed value
* @param mixed $_item value
* @return bool true|false
*/
public function add($_item)
@@ -335,8 +339,9 @@ public function add($_item)
return false;
}
/**
* Method to call when sending data to request for ArrayOf type classe
* Method to call when sending data to request for ArrayOf type class
* @uses PackageNameWsdlClass::getAttributeName()
* @uses PackageNameWsdlClass::__toString()
* @uses PackageNameWsdlClass::_get()
* @return mixed
*/
@@ -389,8 +394,8 @@ public function offsetGet($_offset)
}
/**
* Method useless but necessarly overriden, can't set
* @param null
* @param null
* @param mixed $_offset
* @param mixed $_value
* @return null
*/
public function offsetSet($_offset,$_value)
@@ -399,56 +404,59 @@ public function offsetSet($_offset,$_value)
}
/**
* Method useless but necessarly overriden, can't set
* @param null
* @param null
* @param mixed $_offset
* @return null
*/
public function offsetUnset($_offset)
{
return null;
}
/**
* Method returnint current result from Soap call
* @return mixed
*/
public function getResult()
{
return $this->result;
}
/**
* @param mixed
* @return bool true
* Method setting current result from Soap call
* @param mixed $_result
* @return mixed
*/
protected function setResult($_result)
{
return ($this->result = $_result);
}
/**
* Method returning last errors occured during the calls
* @return array
*/
public function getLastError()
{
return $this->lastError;
}
/**
* @param array
* Method setting last errors occured during the calls
* @param array $_lastError
* @return array
*/
private function setLastError($_lastError)
{
return ($this->lastError = $_lastError);
}
/**
* Method to save the last error returned by the SoapClient
* @param string the method called when the error occurred
* @param Soapault l'objet de l'erreur
* @return bool true
* Method saving the last error returned by the SoapClient
* @param string $_methoName the method called when the error occurred
* @param SoapFault $_soapFault l'objet de l'erreur
* @return bool true|false
*/
protected function saveLastError($_methoName,SoapFault $_soapFault)
{
return ($this->lastError[$_methoName] = $_soapFault);
}
/**
* Method to get the last error for a certain method
* Method getting the last error for a certain method
* @param string method name to get error from
* @return SoapFault|null
*/
@@ -457,28 +465,33 @@ public function getLastErrorForMethod($_methoName)
return (is_array($this->lastError) && array_key_exists($_methoName,$this->lastError))?$this->lastError[$_methoName]:null;
}
/**
* Method returning intern array to iterate trough
* @return array
* @return void
*/
public function getInternArrayToIterate()
{
return $this->internArrayToIterate;
}
/**
* @param array $internArrayToIterate
* Method setting intern array to iterate trough
* @param array $_internArrayToIterate
* @return array
*/
public function setInternArrayToIterate($_internArrayToIterate)
{
return ($this->internArrayToIterate = $_internArrayToIterate);
}
/**
* Method returnint intern array index when iterating trough
* @return int
*/
public function getInternArrayToIterateOffset()
{
return $this->internArrayToIterateOffset;
}
/**
* Function to initiate internArrayToIterate
* Method initiating internArrayToIterate
* @uses PackageNameWsdlClass::setInternArrayToIterate()
* @uses PackageNameWsdlClass::setInternArrayToIterateOffset()
* @uses PackageNameWsdlClass::setInternArrayToIterateIsArray()
@@ -503,30 +516,35 @@ public function initInternArrayToIterate(array $_array = array(),$_interCall = f
}
}
/**
* @param int $internArrayToIterateOffset
* Method setting intern array offset when iterating trough
* @param int $_internArrayToIterateOffset
* @return int
*/
public function setInternArrayToIterateOffset($_internArrayToIterateOffset)
{
$this->internArrayToIterateOffset = $_internArrayToIterateOffset;
return ($this->internArrayToIterateOffset = $_internArrayToIterateOffset);
}
/**
* @return bool
* Method returning true if intern array is an actual array
* @return bool true|false
*/
public function getInternArrayToIterateIsArray()
{
return $this->internArrayToIterateIsArray;
}
/**
* @param bool $internArrayToIterateIsArray
* Method setting if intern array is an actual array
* @param bool $_internArrayToIterateIsArray
* @return bool true|false
*/
public function setInternArrayToIterateIsArray($_internArrayToIterateIsArray = false)
{
return ($this->internArrayToIterateIsArray = $_internArrayToIterateIsArray);
}
/**
* Generic method to set value
* @param string property name to set
* @param mixed property value to use
* Generic method setting value
* @param string $_name property name to set
* @param mixed $_value property value to use
* @return bool
*/
public function _set($_name,$_value)
@@ -541,8 +559,8 @@ public function _set($_name,$_value)
return false;
}
/**
* Generic method to get value
* @param string property name to get
* Generic method getting value
* @param string $_name property name to get
* @return mixed
*/
public function _get($_name)
@@ -554,24 +572,24 @@ public function _get($_name)
return false;
}
/**
* Method which returns alone attribute name when class is ArrayOf type
* Method returning alone attribute name when class is ArrayOf type
* @return string
*/
public function getAttributeName()
{
return '';
}
/**
* Generic method to tell if current value is valid according to the attribute setted with the current value
* @param mixe the value to test
* Generic method telling if current value is valid according to the attribute setted with the current value
* @param mixed $_value the value to test
* @return bool true|false
*/
public static function valueIsValid($_value)
{
return true;
}
/**
* Returns actual class name
* Method returning actual class name
* @return string __CLASS__
*/
public function __toString()

0 comments on commit 1d24b34

Please sign in to comment.
You can’t perform that action at this time.