Skip to content

Commit

Permalink
Optim : Statement has empty body
Browse files Browse the repository at this point in the history
  • Loading branch information
s-renier-taonix-fr authored and f3l1x committed Feb 13, 2023
1 parent 7f9b8c2 commit cee976b
Showing 1 changed file with 31 additions and 26 deletions.
57 changes: 31 additions & 26 deletions src/nusoap.php
Original file line number Diff line number Diff line change
Expand Up @@ -2990,7 +2990,6 @@ function sendRequest($data, $cookies = null)
$this->setCurlOption(CURLOPT_POST, 1);
$this->setCurlOption(CURLOPT_POSTFIELDS, $data);
$this->debug('set cURL POST data');
} else {
}
// insert custom user-set cURL options
foreach ($this->ch_options as $key => $val) {
Expand Down Expand Up @@ -3198,10 +3197,6 @@ function getResponse()
$this->setError($err);
curl_close($this->ch);
return false;
} else {
//echo '<pre>';
//var_dump(curl_getinfo($this->ch));
//echo '</pre>';
}
// close curl
$this->debug('No cURL error, closing cURL');
Expand Down Expand Up @@ -4573,8 +4568,6 @@ function register($name, $in = array(), $out = array(), $namespace = false, $soa
if (!is_array($out)) {
die('You must provide an array for operation outputs');
}
if (!$namespace) {
}
if (!$soapaction) {
if (isset($_SERVER)) {
$SERVER_NAME = $_SERVER['SERVER_NAME'];
Expand Down Expand Up @@ -6497,18 +6490,28 @@ function serializeComplexTypeElements($typeDef, $value, $ns, $uqType, $use = 'en
}
}
} else {
if (is_null($v) && isset($attrs['minOccurs']) && $attrs['minOccurs'] == '0') {
// do nothing
} elseif (is_null($v) && isset($attrs['nillable']) && $attrs['nillable'] == 'true') {
// TODO: serialize a nil correctly, but for now serialize schema-defined type
$xml .= $this->serializeType($eName, isset($attrs['type']) ? $attrs['type'] : $attrs['ref'], $v, $use, $encodingStyle, $unqualified);
} elseif (isset($attrs['type']) || isset($attrs['ref'])) {
// serialize schema-defined type
$xml .= $this->serializeType($eName, isset($attrs['type']) ? $attrs['type'] : $attrs['ref'], $v, $use, $encodingStyle, $unqualified);
} else {
// serialize generic type (can this ever really happen?)
$this->debug("calling serialize_val() for $v, $eName, false, false, false, false, $use");
$xml .= $this->serialize_val($v, $eName, false, false, false, false, $use);
if (!is_null ($v) || !isset($attrs['minOccurs']) || $attrs['minOccurs'] != '0')
{
if (is_null ($v) && isset($attrs['nillable']) && $attrs['nillable'] == 'true')
{
// TODO: serialize a nil correctly, but for now serialize schema-defined type
$xml .= $this->serializeType ($eName,
isset($attrs['type']) ? $attrs['type'] : $attrs['ref'],
$v, $use, $encodingStyle, $unqualified);
}
elseif (isset($attrs['type']) || isset($attrs['ref']))
{
// serialize schema-defined type
$xml .= $this->serializeType ($eName,
isset($attrs['type']) ? $attrs['type'] : $attrs['ref'],
$v, $use, $encodingStyle, $unqualified);
}
else
{
// serialize generic type (can this ever really happen?)
$this->debug ("calling serialize_val() for $v, $eName, false, false, false, false, $use");
$xml .= $this->serialize_val ($v, $eName, false, false, false, false, $use);
}
}
}
}
Expand Down Expand Up @@ -6996,16 +6999,18 @@ function start_element($parser, $name, $attrs)
}
// if it's a type declaration, set type
} elseif ($key_localpart == 'type') {
if (isset($this->message[$pos]['type']) && $this->message[$pos]['type'] == 'array') {
// do nothing: already processed arrayType
} else {
$value_prefix = $this->getPrefix($value);
$value_localpart = $this->getLocalPart($value);
if (!isset($this->message[$pos]['type']) || $this->message[$pos]['type'] != 'array')
{
$value_prefix = $this->getPrefix ($value);
$value_localpart = $this->getLocalPart ($value);
$this->message[$pos]['type'] = $value_localpart;
$this->message[$pos]['typePrefix'] = $value_prefix;
if (isset($this->namespaces[$value_prefix])) {
if (isset($this->namespaces[$value_prefix]))
{
$this->message[$pos]['type_namespace'] = $this->namespaces[$value_prefix];
} elseif (isset($attrs['xmlns:' . $value_prefix])) {
}
elseif (isset($attrs['xmlns:' . $value_prefix]))
{
$this->message[$pos]['type_namespace'] = $attrs['xmlns:' . $value_prefix];
}
// should do something here with the namespace of specified type?
Expand Down

0 comments on commit cee976b

Please sign in to comment.