Permalink
Browse files

- Converted indentation tabs => spaces to match existing style.

- Changed some var names, capitalization, brace position to match existing style.
  • Loading branch information...
1 parent c3ae947 commit 2a48dd5f7f39a3f58c05664f57c062fc7ea8cf00 @evictor evictor committed Aug 13, 2012
Showing with 21 additions and 26 deletions.
  1. +21 −26 SOAP/WSDL.php
View
47 SOAP/WSDL.php
@@ -508,26 +508,25 @@ function _validateString($string)
return preg_match('/^[\w_:#\/]+$/', $string);
}
- function _addArg(&$args, &$argarray, $argname, $nillable = false, &$nillableEls = array())
+ function _addArg(&$args, &$argarray, $argname, $nillable = false, &$nillableArgs = array())
{
if ($args) {
$args .= ', ';
}
$args .= '$' . $argname;
- if($nillable) {
- $args .= ' = NULL';
- $nillableEls[] = $argname;
- }
+ if($nillable) {
+ $args .= ' = null';
+ $nillableArgs[] = $argname;
+ }
if (!$this->_validateString($argname)) {
return;
}
- if(!$nillable)
- {
- if ($argarray) {
- $argarray .= ', ';
- }
- $argarray .= "'$argname' => $" . $argname;
- }
+ if(!$nillable) {
+ if ($argarray) {
+ $argarray .= ', ';
+ }
+ $argarray .= "'$argname' => $" . $argname;
+ }
}
function _elementArg(&$args, &$argarray, &$_argtype, $_argname)
@@ -702,35 +701,31 @@ function generateProxyCode($port = '', $classname = '')
// SOAP_Value.
}
$usingNillables = false;
- $nillableEls = array();
+ $nillableArgs = array();
if (isset($el['elements'])) {
foreach ($el['elements'] as $elname => $elattrs) {
$elname = $this->_sanitize($elname);
if((isset($elattrs['nillable']) && $elattrs['nillable'])
- || (isset($elattrs['minOccurs']) && $elattrs['minOccurs'] == 0))
- {
- // If you encounter one nillable, all subsequent
- // arguments must be defaulted to NULL -- PHP
- // function signature requirement for functions
- // with parameters having defaults
- $usingNillables = true;
+ || (isset($elattrs['minOccurs']) && $elattrs['minOccurs'] == 0)) {
+ // If you encounter one nillable, all subsequent
+ // arguments must default to null
+ $usingNillables = true;
}
// Is the element a complex type?
if (isset($this->complexTypes[$elattrs['namespace']][$elname])) {
$comments .= $this->_complexTypeArg($args, $argarray, $_argtype, $_argname);
} else {
- $this->_addArg($args, $argarray, $elname, $usingNillables, $nillableEls);
+ $this->_addArg($args, $argarray, $elname, $usingNillables, $nillableArgs);
}
}
}
if ($el['complex'] && $argarray) {
$wrapname = '{' . $this->namespaces[$_argtype['namespace']].'}' . $el['name'];
$comments .= " \$v = array($argarray);\n";
- if($usingNillables && !empty($nillableEls)) {
- foreach($nillableEls as $nillableEl)
- {
- $comments .= " isset(\$$nillableEl) && \$v['$nillableEl'] = \$$nillableEl;\n";
- }
+ if($usingNillables && !empty($nillableArgs)) {
+ foreach($nillableArgs as $nillableArg) {
+ $comments .= " isset(\$$nillableArg) && \$v['$nillableArg'] = \$$nillableArg;\n";
+ }
}
$comments .= " \${$el['name']} = new SOAP_Value('$wrapname', false, \$v);\n";
$argarray = "'{$el['name']}' => \${$el['name']}";

0 comments on commit 2a48dd5

Please sign in to comment.