Open TwinMist opened 7 years ago
I've had a look at the code, I suspect either there is no valid response or nothing to reflect into - I'm sure tableType responses did work.
Can you provide a test login and host for me to replicate?
src/BroadworksOCIP/Serializer/XMLSerializer.php
/**
* Builds the object recursively generating and setting ComplexTypes/SimpleTypes/TableTypes along the way.
*
* @param $destinationObject
* @param $simpleXMLElement
* @return object
*/
public function buildComplex($destinationObject, $simpleXMLElement)
{
$reflectionClass = new \ReflectionClass($destinationObject);
$object = $reflectionClass->newInstance();
$methods = get_class_methods($destinationObject);
foreach ($simpleXMLElement->children() as $key => $value) {
$methodName = 'set' . ucfirst($key);
if (in_array($methodName, $methods, null)) {
if (count($value->children()) === 0) {
$object->$methodName((string)$value);
} else {
if (preg_match('/Table/i', (string)$key)) {
$obj = new TableType($key, $value);
} else {
$method = $reflectionClass->getMethod($methodName)->getParameters();
// PHP Fatal thrown here
$type = $method[0]->getClass()->getName();
$obj = $this->buildComplex($type, $value);
}
$object->$methodName($obj);
}
}
}
return $object;
}
Hi When you try and do a XXXXGetListRequest for any service with a department it fails with the following
PHP Fatal error: Call to a member function getName() on null in /var/www/html/vendor/lukebeer/broadworks-ocip/src/BroadworksOCIP/Serializer/XMLSerializer.php on line 60
any ideas? cheers