Passed
Branch feature/php-cs-fixer (09bfdb)
by Michael
04:55
created
samples/wsdlclient12.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -44,21 +44,21 @@
 block discarded – undo
44 44
 	global $SubscriptionId;
45 45
 
46 46
 	// create items to be added to the cart
47
-	$item = array ();
48
-	$item[0] = array(  "ASIN" => "0596004206",
47
+	$item = array();
48
+	$item[0] = array("ASIN" => "0596004206",
49 49
 					   "Quantity" => "1"
50 50
 					);
51
-	$item[1] = array(  "ASIN" => "0596003277",
51
+	$item[1] = array("ASIN" => "0596003277",
52 52
 					   "Quantity" => "2"
53 53
 					);
54 54
 
55 55
 	// pack it to <Item> array
56
-	$items =  array("Item" => $item);
56
+	$items = array("Item" => $item);
57 57
 	// Construct request parameters
58 58
 	$request = array("Items" => $items, "ResponseGroup" => "CartSimilarities");
59 59
 	
60 60
 	// Construct  all parameters
61
-	$cartCreate = array(	"SubscriptionId"  => $SubscriptionId,
61
+	$cartCreate = array("SubscriptionId"  => $SubscriptionId,
62 62
 							"Request" => $request
63 63
 					 	);
64 64
 
Please login to merge, or discard this patch.
samples/wsdlclient4.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -25,10 +25,10 @@
 block discarded – undo
25 25
  */
26 26
 if ($method == '') {
27 27
 	echo '<form name="MethodForm" method="POST">';
28
-	echo '<input type="hidden" name="proxyhost" value="' . $proxyhost .'">';
29
-	echo '<input type="hidden" name="proxyport" value="' . $proxyport .'">';
30
-	echo '<input type="hidden" name="proxyusername" value="' . $proxyusername .'">';
31
-	echo '<input type="hidden" name="proxypassword" value="' . $proxypassword .'">';
28
+	echo '<input type="hidden" name="proxyhost" value="' . $proxyhost . '">';
29
+	echo '<input type="hidden" name="proxyport" value="' . $proxyport . '">';
30
+	echo '<input type="hidden" name="proxyusername" value="' . $proxyusername . '">';
31
+	echo '<input type="hidden" name="proxypassword" value="' . $proxypassword . '">';
32 32
 	echo 'Method: <select name="method">';
33 33
 	echo '<option>echoString</option>';
34 34
 	echo '<option>echoStringArray</option>';
Please login to merge, or discard this patch.
src/nusoap.php 1 patch
Spacing   +75 added lines, -75 removed lines patch added patch discarded remove patch
@@ -472,7 +472,7 @@  discard block
 block discarded – undo
472 472
         if ($name_ns) {
473 473
             $prefix = 'nu' . mt_rand(1000, 9999);
474 474
             $name   = $prefix . ':' . $name;
475
-            $xmlns  .= " xmlns:$prefix=\"$name_ns\"";
475
+            $xmlns .= " xmlns:$prefix=\"$name_ns\"";
476 476
         }
477 477
         // if type is prefixed, create type prefix
478 478
         if ('' !== $type_ns && $type_ns === $this->namespaces['xsd']) {
@@ -481,7 +481,7 @@  discard block
 block discarded – undo
481 481
             $type_prefix = 'xsd';
482 482
         } elseif ($type_ns) {
483 483
             $type_prefix = 'ns' . mt_rand(1000, 9999);
484
-            $xmlns       .= " xmlns:$type_prefix=\"$type_ns\"";
484
+            $xmlns .= " xmlns:$type_prefix=\"$type_ns\"";
485 485
         }
486 486
         // serialize attributes if present
487 487
         $atts = '';
@@ -648,7 +648,7 @@  discard block
 block discarded – undo
648 648
                             } elseif ($tt_ns) {
649 649
                                 $tt_prefix      = 'ns' . mt_rand(1000, 9999);
650 650
                                 $array_typename = "$tt_prefix:$tt";
651
-                                $xmlns          .= " xmlns:$tt_prefix=\"$tt_ns\"";
651
+                                $xmlns .= " xmlns:$tt_prefix=\"$tt_ns\"";
652 652
                             } else {
653 653
                                 $array_typename = $tt;
654 654
                             }
@@ -964,12 +964,12 @@  discard block
 block discarded – undo
964 964
         }
965 965
     }
966 966
     if ($utc) {
967
-        $pattern = '/' . '([0-9]{4})-' .    // centuries & years CCYY-
968
-                   '([0-9]{2})-' .    // months MM-
969
-                   '([0-9]{2})' .    // days DD
970
-                   'T' .            // separator T
971
-                   '([0-9]{2}):' .    // hours hh:
972
-                   '([0-9]{2}):' .    // minutes mm:
967
+        $pattern = '/' . '([0-9]{4})-' . // centuries & years CCYY-
968
+                   '([0-9]{2})-' . // months MM-
969
+                   '([0-9]{2})' . // days DD
970
+                   'T' . // separator T
971
+                   '([0-9]{2}):' . // hours hh:
972
+                   '([0-9]{2}):' . // minutes mm:
973 973
                    '([0-9]{2})(\.[0-9]*)?' . // seconds ss.ss...
974 974
                    '(Z|[+\-][0-9]{2}:?[0-9]{2})?' . // Z to indicate UTC, -/+HH:MM:SS.SS... for local tz's
975 975
                    '/';
@@ -991,12 +991,12 @@  discard block
 block discarded – undo
991 991
  */
992 992
 function iso8601_to_timestamp($datestr)
993 993
 {
994
-    $pattern = '/' . '([0-9]{4})-' .    // centuries & years CCYY-
995
-               '([0-9]{2})-' .    // months MM-
996
-               '([0-9]{2})' .    // days DD
997
-               'T' .            // separator T
998
-               '([0-9]{2}):' .    // hours hh:
999
-               '([0-9]{2}):' .    // minutes mm:
994
+    $pattern = '/' . '([0-9]{4})-' . // centuries & years CCYY-
995
+               '([0-9]{2})-' . // months MM-
996
+               '([0-9]{2})' . // days DD
997
+               'T' . // separator T
998
+               '([0-9]{2}):' . // hours hh:
999
+               '([0-9]{2}):' . // minutes mm:
1000 1000
                '([0-9]{2})(\.[0-9]+)?' . // seconds ss.ss...
1001 1001
                '(Z|[+\-][0-9]{2}:?[0-9]{2})?' . // Z to indicate UTC, -/+HH:MM:SS.SS... for local tz's
1002 1002
                '/';
@@ -1033,7 +1033,7 @@  discard block
 block discarded – undo
1033 1033
     $start = gettimeofday();
1034 1034
     do {
1035 1035
         $stop       = gettimeofday();
1036
-        $timePassed = 1000000 * ($stop['sec'] - $start['sec']) + $stop['usec'] - $start['usec'];
1036
+        $timePassed = 1000000*($stop['sec'] - $start['sec']) + $stop['usec'] - $start['usec'];
1037 1037
     } while ($timePassed < $usec);
1038 1038
 }
1039 1039
 
@@ -1677,7 +1677,7 @@  discard block
 block discarded – undo
1677 1677
      */
1678 1678
     private function schemaCharacterData($parser, $data)
1679 1679
     {
1680
-        $pos                          = $this->depth_array[$this->depth - 1];
1680
+        $pos = $this->depth_array[$this->depth - 1];
1681 1681
         $this->message[$pos]['cdata'] .= $data;
1682 1682
     }
1683 1683
 
@@ -2235,13 +2235,13 @@  discard block
 block discarded – undo
2235 2235
     public $incoming_cookies     = [];
2236 2236
     public $outgoing_payload     = '';
2237 2237
     public $incoming_payload     = '';
2238
-    public $response_status_line;    // HTTP response status line
2238
+    public $response_status_line; // HTTP response status line
2239 2239
     public $useSOAPAction        = true;
2240 2240
     public $persistentConnection = false;
2241
-    public $ch                   = false;    // cURL handle
2242
-    public $ch_options           = [];    // cURL custom options
2243
-    public $use_curl             = false;        // force cURL use
2244
-    public $proxy;            // proxy information (associative array)
2241
+    public $ch                   = false; // cURL handle
2242
+    public $ch_options           = []; // cURL custom options
2243
+    public $use_curl             = false; // force cURL use
2244
+    public $proxy; // proxy information (associative array)
2245 2245
     public $username             = '';
2246 2246
     public $password             = '';
2247 2247
     public $authtype             = '';
@@ -3039,7 +3039,7 @@  discard block
 block discarded – undo
3039 3039
                 }
3040 3040
 
3041 3041
                 $data .= $tmp;
3042
-                $pos  = mb_strpos($data, "\r\n\r\n");
3042
+                $pos = mb_strpos($data, "\r\n\r\n");
3043 3043
                 if ($pos > 1) {
3044 3044
                     $lb = "\r\n";
3045 3045
                 } else {
@@ -3085,7 +3085,7 @@  discard block
 block discarded – undo
3085 3085
 
3086 3086
             // loop until msg has been received
3087 3087
             if (isset($this->incoming_headers['transfer-encoding']) && 'chunked' === mb_strtolower($this->incoming_headers['transfer-encoding'])) {
3088
-                $content_length = 2147483647;    // ignore any content-length header
3088
+                $content_length = 2147483647; // ignore any content-length header
3089 3089
                 $chunked        = true;
3090 3090
                 $this->debug('want to read chunked content');
3091 3091
             } elseif (isset($this->incoming_headers['content-length'])) {
@@ -3265,7 +3265,7 @@  discard block
 block discarded – undo
3265 3265
         $this->response_status_line = $header_array[0];
3266 3266
         $arr                        = explode(' ', $this->response_status_line, 3);
3267 3267
         $http_version               = $arr[0];
3268
-        $http_status                = (int)$arr[1];
3268
+        $http_status                = (int) $arr[1];
3269 3269
         $http_reason                = count($arr) > 2 ? $arr[2] : '';
3270 3270
         // see if we need to resend the request with http digest authentication
3271 3271
         if (isset($this->incoming_headers['location']) && (301 === $http_status || 302 === $http_status)) {
@@ -3825,7 +3825,7 @@  discard block
 block discarded – undo
3825 3825
             foreach ($headers as $k => $v) {
3826 3826
                 $k                 = mb_strtolower($k);
3827 3827
                 $this->headers[$k] = $v;
3828
-                $this->request     .= "$k: $v\r\n";
3828
+                $this->request .= "$k: $v\r\n";
3829 3829
                 $this->debug("$k: $v");
3830 3830
             }
3831 3831
             // get SOAPAction header
@@ -3873,7 +3873,7 @@  discard block
 block discarded – undo
3873 3873
                     }
3874 3874
                 }
3875 3875
                 $this->headers[$k] = $v;
3876
-                $this->request     .= "$k: $v\r\n";
3876
+                $this->request .= "$k: $v\r\n";
3877 3877
                 $this->debug("$k: $v");
3878 3878
             }
3879 3879
         } else {
@@ -3930,7 +3930,7 @@  discard block
 block discarded – undo
3930 3930
                 }
3931 3931
             }
3932 3932
         }
3933
-        $this->request     .= "\r\n" . $data;
3933
+        $this->request .= "\r\n" . $data;
3934 3934
         $data              = $this->parseRequest($this->headers, $data);
3935 3935
         $this->requestSOAP = $data;
3936 3936
         $this->debug('leaving parse_request');
@@ -4449,7 +4449,7 @@  discard block
 block discarded – undo
4449 4449
             if (null !== $_SERVER) {
4450 4450
                 $SERVER_NAME = $_SERVER['SERVER_NAME'];
4451 4451
                 $SCRIPT_NAME = isset($_SERVER['PHP_SELF']) ? $_SERVER['PHP_SELF'] : $_SERVER['SCRIPT_NAME'];
4452
-                $HTTPS = isset($_SERVER['HTTPS']) ? : 'off';
4452
+                $HTTPS = isset($_SERVER['HTTPS']) ?: 'off';
4453 4453
             } else {
4454 4454
                 $this->setError(' _SERVER  is not available');
4455 4455
             }
@@ -4573,7 +4573,7 @@  discard block
 block discarded – undo
4573 4573
             'transport' => $transport,
4574 4574
             'portType'  => $serviceName . 'PortType',
4575 4575
         ];
4576
-        $this->wsdl->ports[$serviceName . 'Port']                                                                = [
4576
+        $this->wsdl->ports[$serviceName . 'Port'] = [
4577 4577
             'binding'     => $serviceName . 'Binding',
4578 4578
             'location'    => $endpoint,
4579 4579
             'bindingType' => 'http://schemas.xmlsoap.org/wsdl/soap/',
@@ -4631,13 +4631,13 @@  discard block
 block discarded – undo
4631 4631
     public $proxypassword    = '';
4632 4632
     public $timeout          = 0;
4633 4633
     public $response_timeout = 30;
4634
-    public $curl_options     = [];    // User-specified cURL options
4635
-    public $use_curl         = false;            // whether to always try to use cURL
4634
+    public $curl_options     = []; // User-specified cURL options
4635
+    public $use_curl         = false; // whether to always try to use cURL
4636 4636
     // for HTTP authentication
4637
-    public $username    = '';                // Username for HTTP authentication
4638
-    public $password    = '';                // Password for HTTP authentication
4639
-    public $authtype    = '';                // Type of HTTP authentication
4640
-    public $certRequest = [];        // Certificate for HTTP SSL authentication
4637
+    public $username    = ''; // Username for HTTP authentication
4638
+    public $password    = ''; // Password for HTTP authentication
4639
+    public $authtype    = ''; // Type of HTTP authentication
4640
+    public $certRequest = []; // Certificate for HTTP SSL authentication
4641 4641
 
4642 4642
     /**
4643 4643
      * Constructor
@@ -4691,7 +4691,7 @@  discard block
 block discarded – undo
4691 4691
             // Schema imports
4692 4692
             foreach ($this->schemas as $ns => $list) {
4693 4693
                 foreach ($list as $xs) {
4694
-                    $wsdlparts = parse_url($this->wsdl);    // this is bogusly simple!
4694
+                    $wsdlparts = parse_url($this->wsdl); // this is bogusly simple!
4695 4695
                     foreach ($xs->imports as $ns2 => $list2) {
4696 4696
                         for ($ii = 0, $iiMax = count($list2); $ii < $iiMax; ++$ii) {
4697 4697
                             if (!$list2[$ii]['loaded']) {
@@ -4716,7 +4716,7 @@  discard block
 block discarded – undo
4716 4716
                 }
4717 4717
             }
4718 4718
             // WSDL imports
4719
-            $wsdlparts = parse_url($this->wsdl);    // this is bogusly simple!
4719
+            $wsdlparts = parse_url($this->wsdl); // this is bogusly simple!
4720 4720
             foreach ($this->import as $ns => $list) {
4721 4721
                 for ($ii = 0, $iiMax = count($list); $ii < $iiMax; ++$ii) {
4722 4722
                     if (!$list[$ii]['loaded']) {
@@ -5584,12 +5584,12 @@  discard block
 block discarded – undo
5584 5584
                 foreach ($attrs['operations'] as $opName => $opParts) {
5585 5585
                     $binding_xml .= "\n" . '  <operation name="' . $opName . '">';
5586 5586
                     $binding_xml .= "\n" . '    <soap:operation soapAction="' . $opParts['soapAction'] . '" style="' . $opParts['style'] . '">';
5587
-                    $enc_style   = '';
5587
+                    $enc_style = '';
5588 5588
                     if (isset($opParts['input']['encodingStyle']) && '' !== $opParts['input']['encodingStyle']) {
5589 5589
                         $enc_style = ' encodingStyle="' . $opParts['input']['encodingStyle'] . '"';
5590 5590
                     }
5591 5591
                     $binding_xml .= "\n" . '    <input><soap:body use="' . $opParts['input']['use'] . '" namespace="' . $opParts['input']['namespace'] . '"' . $enc_style . '></input>';
5592
-                    $enc_style   = '';
5592
+                    $enc_style = '';
5593 5593
                     if (isset($opParts['output']['encodingStyle']) && '' !== $opParts['output']['encodingStyle']) {
5594 5594
                         $enc_style = ' encodingStyle="' . $opParts['output']['encodingStyle'] . '"';
5595 5595
                     }
@@ -6558,7 +6558,7 @@  discard block
 block discarded – undo
6558 6558
     public $root_struct_name      = '';
6559 6559
     public $root_struct_namespace = '';
6560 6560
     public $root_header           = '';
6561
-    public $document              = '';            // incoming SOAP body (text)
6561
+    public $document              = ''; // incoming SOAP body (text)
6562 6562
     // determines where in the message we are (envelope,header,body,method)
6563 6563
     public $status            = '';
6564 6564
     public $position          = 0;
@@ -6573,9 +6573,9 @@  discard block
 block discarded – undo
6573 6573
     public $fault_detail    = '';
6574 6574
     public $depth_array     = [];
6575 6575
     public $debug_flag      = true;
6576
-    public $soapresponse;    // parsed SOAP Body
6577
-    public $soapheader;        // parsed SOAP Header
6578
-    public $responseHeaders = '';    // incoming SOAP headers (text)
6576
+    public $soapresponse; // parsed SOAP Body
6577
+    public $soapheader; // parsed SOAP Header
6578
+    public $responseHeaders = ''; // incoming SOAP headers (text)
6579 6579
     public $body_position   = 0;
6580 6580
     // for multiref parsing:
6581 6581
     // array of id => pos
@@ -7017,20 +7017,20 @@  discard block
 block discarded – undo
7017 7017
     {
7018 7018
         // TODO: use the namespace!
7019 7019
         if (!isset($type) || 'string' === $type || 'long' === $type || 'unsignedLong' === $type) {
7020
-            return (string)$value;
7020
+            return (string) $value;
7021 7021
         }
7022 7022
         if ('int' === $type || 'integer' === $type || 'short' === $type || 'byte' === $type) {
7023
-            return (int)$value;
7023
+            return (int) $value;
7024 7024
         }
7025 7025
         if ('float' === $type || 'double' === $type || 'decimal' === $type) {
7026
-            return (float)$value;
7026
+            return (float) $value;
7027 7027
         }
7028 7028
         if ('boolean' === $type) {
7029 7029
             if ('false' === mb_strtolower($value) || 'f' === mb_strtolower($value)) {
7030 7030
                 return false;
7031 7031
             }
7032 7032
 
7033
-            return (bool)$value;
7033
+            return (bool) $value;
7034 7034
         }
7035 7035
         if ('base64' === $type || 'base64Binary' === $type) {
7036 7036
             $this->debug('Decode base64 value');
@@ -7039,14 +7039,14 @@  discard block
 block discarded – undo
7039 7039
         }
7040 7040
         // obscure numeric types
7041 7041
         if ('nonPositiveInteger' === $type || 'negativeInteger' === $type || 'nonNegativeInteger' === $type || 'positiveInteger' === $type || 'unsignedInt' === $type || 'unsignedShort' === $type || 'unsignedByte' === $type) {
7042
-            return (int)$value;
7042
+            return (int) $value;
7043 7043
         }
7044 7044
         // bogus: parser treats array with no elements as a simple type
7045 7045
         if ('array' === $type) {
7046 7046
             return [];
7047 7047
         }
7048 7048
         // everything else
7049
-        return (string)$value;
7049
+        return (string) $value;
7050 7050
     }
7051 7051
 
7052 7052
     /**
@@ -7195,37 +7195,37 @@  discard block
 block discarded – undo
7195 7195
  */
7196 7196
 class Nusoap_client extends Nusoap_base
7197 7197
 {
7198
-    public $username             = '';                // Username for HTTP authentication
7199
-    public $password             = '';                // Password for HTTP authentication
7200
-    public $authtype             = '';                // Type of HTTP authentication
7201
-    public $certRequest          = [];        // Certificate for HTTP SSL authentication
7202
-    public $requestHeaders       = false;    // SOAP headers in request (text)
7203
-    public $responseHeaders      = '';        // SOAP headers from response (incomplete namespace resolution) (text)
7204
-    public $responseHeader;        // SOAP Header from response (parsed)
7205
-    public $document             = '';                // SOAP body response portion (incomplete namespace resolution) (text)
7198
+    public $username             = ''; // Username for HTTP authentication
7199
+    public $password             = ''; // Password for HTTP authentication
7200
+    public $authtype             = ''; // Type of HTTP authentication
7201
+    public $certRequest          = []; // Certificate for HTTP SSL authentication
7202
+    public $requestHeaders       = false; // SOAP headers in request (text)
7203
+    public $responseHeaders      = ''; // SOAP headers from response (incomplete namespace resolution) (text)
7204
+    public $responseHeader; // SOAP Header from response (parsed)
7205
+    public $document             = ''; // SOAP body response portion (incomplete namespace resolution) (text)
7206 7206
     public $endpoint;
7207
-    public $forceEndpoint        = '';        // overrides WSDL endpoint
7207
+    public $forceEndpoint        = ''; // overrides WSDL endpoint
7208 7208
     public $proxyhost            = '';
7209 7209
     public $proxyport            = '';
7210 7210
     public $proxyusername        = '';
7211 7211
     public $proxypassword        = '';
7212
-    public $portName             = '';                // port name to use in WSDL
7213
-    public $xml_encoding         = '';            // character set encoding of incoming (response) messages
7212
+    public $portName             = ''; // port name to use in WSDL
7213
+    public $xml_encoding         = ''; // character set encoding of incoming (response) messages
7214 7214
     public $http_encoding        = false;
7215
-    public $timeout              = 0;                // HTTP connection timeout
7216
-    public $response_timeout     = 30;        // HTTP response timeout
7217
-    public $endpointType         = '';            // soap|wsdl, empty for WSDL initialization error
7215
+    public $timeout              = 0; // HTTP connection timeout
7216
+    public $response_timeout     = 30; // HTTP response timeout
7217
+    public $endpointType         = ''; // soap|wsdl, empty for WSDL initialization error
7218 7218
     public $persistentConnection = false;
7219
-    public $defaultRpcParams     = false;    // This is no longer used
7220
-    public $request              = '';                // HTTP request
7221
-    public $response             = '';                // HTTP response
7222
-    public $responseData         = '';            // SOAP payload of response
7223
-    public $cookies              = [];            // Cookies from response or for request
7224
-    public $decode_utf8          = true;        // toggles whether the parser decodes element content w/ utf8_decode()
7225
-    public $operations           = [];        // WSDL operations, empty for WSDL initialization error
7226
-    public $curl_options         = [];    // User-specified cURL options
7227
-    public $bindingType          = '';            // WSDL operation binding type
7228
-    public $use_curl             = false;            // whether to always try to use cURL
7219
+    public $defaultRpcParams     = false; // This is no longer used
7220
+    public $request              = ''; // HTTP request
7221
+    public $response             = ''; // HTTP response
7222
+    public $responseData         = ''; // SOAP payload of response
7223
+    public $cookies              = []; // Cookies from response or for request
7224
+    public $decode_utf8          = true; // toggles whether the parser decodes element content w/ utf8_decode()
7225
+    public $operations           = []; // WSDL operations, empty for WSDL initialization error
7226
+    public $curl_options         = []; // User-specified cURL options
7227
+    public $bindingType          = ''; // WSDL operation binding type
7228
+    public $use_curl             = false; // whether to always try to use cURL
7229 7229
 
7230 7230
     /*
7231 7231
      * Fault related variables
@@ -7951,7 +7951,7 @@  discard block
 block discarded – undo
7951 7951
                     $paramCommentStr = 'void';
7952 7952
                 }
7953 7953
                 $opData['namespace'] = !isset($opData['namespace']) ? 'http://testuri.com' : $opData['namespace'];
7954
-                $evalStr             .= "// $paramCommentStr
7954
+                $evalStr .= "// $paramCommentStr
7955 7955
 	function " . str_replace('.', '__', $operation) . "($paramStr) {
7956 7956
 		\$params = array($paramArrayStr);
7957 7957
 		return \$this->call('$operation', \$params, '" . $opData['namespace'] . "', '" . (isset($opData['soapAction']) ? $opData['soapAction'] : '') . "');
Please login to merge, or discard this patch.