Skip to content

Commit

Permalink
Optim : Unnecessary local variable
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 2ca8a00 commit f059204
Showing 1 changed file with 28 additions and 30 deletions.
58 changes: 28 additions & 30 deletions src/nusoap.php
Original file line number Diff line number Diff line change
Expand Up @@ -1101,19 +1101,18 @@ function serialize()
foreach ($this->namespaces as $k => $v) {
$ns_string .= "\n xmlns:$k=\"$v\"";
}
$return_msg =
'<?xml version="1.0" encoding="' . $this->soap_defencoding . '"?>' .
'<SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"' . $ns_string . ">\n" .
'<SOAP-ENV:Body>' .
'<SOAP-ENV:Fault>' .
$this->serialize_val($this->faultcode, 'faultcode') .
$this->serialize_val($this->faultstring, 'faultstring') .
$this->serialize_val($this->faultactor, 'faultactor') .
$this->serialize_val($this->faultdetail, 'detail') .
'</SOAP-ENV:Fault>' .
'</SOAP-ENV:Body>' .
'</SOAP-ENV:Envelope>';
return $return_msg;

return '<?xml version="1.0" encoding="' . $this->soap_defencoding . '"?>' .
'<SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"' . $ns_string . ">\n" .
'<SOAP-ENV:Body>' .
'<SOAP-ENV:Fault>' .
$this->serialize_val($this->faultcode, 'faultcode') .
$this->serialize_val($this->faultstring, 'faultstring') .
$this->serialize_val($this->faultactor, 'faultactor') .
$this->serialize_val($this->faultdetail, 'detail') .
'</SOAP-ENV:Fault>' .
'</SOAP-ENV:Body>' .
'</SOAP-ENV:Envelope>';
}
}

Expand Down Expand Up @@ -1790,8 +1789,8 @@ function serializeSchema()
foreach (array_diff($this->usedNamespaces, $this->enclosingNamespaces) as $nsp => $ns) {
$el .= " xmlns:$nsp=\"$ns\"";
}
$xml = $el . ">\n" . $xml . "</$schemaPrefix:schema>\n";
return $xml;

return $el . ">\n" . $xml . "</$schemaPrefix:schema>\n";
}

/**
Expand Down Expand Up @@ -3493,14 +3492,14 @@ function parseCookie($cookie_str)
if ($sep_pos) {
$name = substr($value_str, 0, $sep_pos);
$value = substr($value_str, $sep_pos + 1);
$cookie = array('name' => $name,
'value' => $value,
'domain' => $domain,
'path' => $path,
'expires' => $expires,
'secure' => $secure
);
return $cookie;

return array('name' => $name,
'value' => $value,
'domain' => $domain,
'path' => $path,
'expires' => $expires,
'secure' => $secure
);
}
return false;
}
Expand Down Expand Up @@ -5409,8 +5408,7 @@ function getOperationData($operation, $bindingType = 'soap')
foreach (array_keys($this->bindings[$portData['binding']]['operations']) as $bOperation) {
// note that we could/should also check the namespace here
if ($operation == $bOperation) {
$opData = $this->bindings[$portData['binding']]['operations'][$operation];
return $opData;
return $this->bindings[$portData['binding']]['operations'][$operation];
}
}
}
Expand Down Expand Up @@ -8238,8 +8236,8 @@ function _getProxyClassCode($r)
if ($this->endpointType != 'wsdl') {
$evalStr = 'A proxy can only be created for a WSDL client';
$this->setError($evalStr);
$evalStr = "echo \"$evalStr\";";
return $evalStr;

return "echo \"$evalStr\";";
}
if ($this->endpointType == 'wsdl' && is_null($this->wsdl)) {
$this->loadWSDL();
Expand Down Expand Up @@ -8279,10 +8277,10 @@ function " . str_replace('.', '__', $operation) . "($paramStr) {
unset($paramCommentStr);
}
}
$evalStr = 'class nusoap_proxy_' . $r . ' extends nusoap_client {
' . $evalStr . '

return 'class nusoap_proxy_' . $r . ' extends nusoap_client {
' . $evalStr . '
}';
return $evalStr;
}

/**
Expand Down

0 comments on commit f059204

Please sign in to comment.