Passed
Branch feature/php-cs-fixer (60ba9d)
by Michael
03:35
created
src/nusoap.php 1 patch
Spacing   +76 added lines, -76 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 = '';
@@ -647,7 +647,7 @@  discard block
 block discarded – undo
647 647
                             } elseif ($tt_ns) {
648 648
                                 $tt_prefix      = 'ns' . mt_rand(1000, 9999);
649 649
                                 $array_typename = "$tt_prefix:$tt";
650
-                                $xmlns          .= " xmlns:$tt_prefix=\"$tt_ns\"";
650
+                                $xmlns .= " xmlns:$tt_prefix=\"$tt_ns\"";
651 651
                             } else {
652 652
                                 $array_typename = $tt;
653 653
                             }
@@ -963,12 +963,12 @@  discard block
 block discarded – undo
963 963
         }
964 964
     }
965 965
     if ($utc) {
966
-        $pattern = '/' . '([0-9]{4})-' .    // centuries & years CCYY-
967
-                   '([0-9]{2})-' .    // months MM-
968
-                   '([0-9]{2})' .    // days DD
969
-                   'T' .            // separator T
970
-                   '([0-9]{2}):' .    // hours hh:
971
-                   '([0-9]{2}):' .    // minutes mm:
966
+        $pattern = '/' . '([0-9]{4})-' . // centuries & years CCYY-
967
+                   '([0-9]{2})-' . // months MM-
968
+                   '([0-9]{2})' . // days DD
969
+                   'T' . // separator T
970
+                   '([0-9]{2}):' . // hours hh:
971
+                   '([0-9]{2}):' . // minutes mm:
972 972
                    '([0-9]{2})(\.[0-9]*)?' . // seconds ss.ss...
973 973
                    '(Z|[+\-][0-9]{2}:?[0-9]{2})?' . // Z to indicate UTC, -/+HH:MM:SS.SS... for local tz's
974 974
                    '/';
@@ -990,12 +990,12 @@  discard block
 block discarded – undo
990 990
  */
991 991
 function iso8601_to_timestamp($datestr)
992 992
 {
993
-    $pattern = '/' . '([0-9]{4})-' .    // centuries & years CCYY-
994
-               '([0-9]{2})-' .    // months MM-
995
-               '([0-9]{2})' .    // days DD
996
-               'T' .            // separator T
997
-               '([0-9]{2}):' .    // hours hh:
998
-               '([0-9]{2}):' .    // minutes mm:
993
+    $pattern = '/' . '([0-9]{4})-' . // centuries & years CCYY-
994
+               '([0-9]{2})-' . // months MM-
995
+               '([0-9]{2})' . // days DD
996
+               'T' . // separator T
997
+               '([0-9]{2}):' . // hours hh:
998
+               '([0-9]{2}):' . // minutes mm:
999 999
                '([0-9]{2})(\.[0-9]+)?' . // seconds ss.ss...
1000 1000
                '(Z|[+\-][0-9]{2}:?[0-9]{2})?' . // Z to indicate UTC, -/+HH:MM:SS.SS... for local tz's
1001 1001
                '/';
@@ -1032,7 +1032,7 @@  discard block
 block discarded – undo
1032 1032
     $start = gettimeofday();
1033 1033
     do {
1034 1034
         $stop       = gettimeofday();
1035
-        $timePassed = 1000000 * ($stop['sec'] - $start['sec']) + $stop['usec'] - $start['usec'];
1035
+        $timePassed = 1000000*($stop['sec'] - $start['sec']) + $stop['usec'] - $start['usec'];
1036 1036
     } while ($timePassed < $usec);
1037 1037
 }
1038 1038
 
@@ -1674,7 +1674,7 @@  discard block
 block discarded – undo
1674 1674
      */
1675 1675
     private function schemaCharacterData($parser, $data)
1676 1676
     {
1677
-        $pos                          = $this->depth_array[$this->depth - 1];
1677
+        $pos = $this->depth_array[$this->depth - 1];
1678 1678
         $this->message[$pos]['cdata'] .= $data;
1679 1679
     }
1680 1680
 
@@ -2229,18 +2229,18 @@  discard block
 block discarded – undo
2229 2229
     public $incoming_cookies     = [];
2230 2230
     public $outgoing_payload     = '';
2231 2231
     public $incoming_payload     = '';
2232
-    public $response_status_line;    // HTTP response status line
2232
+    public $response_status_line; // HTTP response status line
2233 2233
     public $useSOAPAction        = true;
2234 2234
     public $persistentConnection = false;
2235
-    public $ch                   = false;    // cURL handle
2236
-    public $ch_options           = [];    // cURL custom options
2237
-    public $use_curl             = false;        // force cURL use
2238
-    public $proxy;            // proxy information (associative array)
2235
+    public $ch                   = false; // cURL handle
2236
+    public $ch_options           = []; // cURL custom options
2237
+    public $use_curl             = false; // force cURL use
2238
+    public $proxy; // proxy information (associative array)
2239 2239
     public $username             = '';
2240 2240
     public $password             = '';
2241 2241
     public $authtype             = '';
2242 2242
     public $digestRequest        = [];
2243
-    public $certRequest          = [];    // keys must be cainfofile (optional), sslcertfile, sslkeyfile, passphrase, certpassword (optional), verifypeer (optional), verifyhost (optional)
2243
+    public $certRequest          = []; // keys must be cainfofile (optional), sslcertfile, sslkeyfile, passphrase, certpassword (optional), verifypeer (optional), verifyhost (optional)
2244 2244
     // cainfofile: certificate authority file, e.g. '$pathToPemFiles/rootca.pem'
2245 2245
     // sslcertfile: SSL certificate file, e.g. '$pathToPemFiles/mycert.pem'
2246 2246
     // sslkeyfile: SSL key file, e.g. '$pathToPemFiles/mykey.pem'
@@ -3029,7 +3029,7 @@  discard block
 block discarded – undo
3029 3029
                 }
3030 3030
 
3031 3031
                 $data .= $tmp;
3032
-                $pos  = mb_strpos($data, "\r\n\r\n");
3032
+                $pos = mb_strpos($data, "\r\n\r\n");
3033 3033
                 if ($pos > 1) {
3034 3034
                     $lb = "\r\n";
3035 3035
                 } else {
@@ -3075,7 +3075,7 @@  discard block
 block discarded – undo
3075 3075
 
3076 3076
             // loop until msg has been received
3077 3077
             if (isset($this->incoming_headers['transfer-encoding']) && 'chunked' === mb_strtolower($this->incoming_headers['transfer-encoding'])) {
3078
-                $content_length = 2147483647;    // ignore any content-length header
3078
+                $content_length = 2147483647; // ignore any content-length header
3079 3079
                 $chunked        = true;
3080 3080
                 $this->debug('want to read chunked content');
3081 3081
             } elseif (isset($this->incoming_headers['content-length'])) {
@@ -3255,7 +3255,7 @@  discard block
 block discarded – undo
3255 3255
         $this->response_status_line = $header_array[0];
3256 3256
         $arr                        = explode(' ', $this->response_status_line, 3);
3257 3257
         $http_version               = $arr[0];
3258
-        $http_status                = (int)$arr[1];
3258
+        $http_status                = (int) $arr[1];
3259 3259
         $http_reason                = count($arr) > 2 ? $arr[2] : '';
3260 3260
         // see if we need to resend the request with http digest authentication
3261 3261
         if (isset($this->incoming_headers['location']) && (301 === $http_status || 302 === $http_status)) {
@@ -3815,7 +3815,7 @@  discard block
 block discarded – undo
3815 3815
             foreach ($headers as $k => $v) {
3816 3816
                 $k                 = mb_strtolower($k);
3817 3817
                 $this->headers[$k] = $v;
3818
-                $this->request     .= "$k: $v\r\n";
3818
+                $this->request .= "$k: $v\r\n";
3819 3819
                 $this->debug("$k: $v");
3820 3820
             }
3821 3821
             // get SOAPAction header
@@ -3863,7 +3863,7 @@  discard block
 block discarded – undo
3863 3863
                     }
3864 3864
                 }
3865 3865
                 $this->headers[$k] = $v;
3866
-                $this->request     .= "$k: $v\r\n";
3866
+                $this->request .= "$k: $v\r\n";
3867 3867
                 $this->debug("$k: $v");
3868 3868
             }
3869 3869
         } else {
@@ -3920,7 +3920,7 @@  discard block
 block discarded – undo
3920 3920
                 }
3921 3921
             }
3922 3922
         }
3923
-        $this->request     .= "\r\n" . $data;
3923
+        $this->request .= "\r\n" . $data;
3924 3924
         $data              = $this->parseRequest($this->headers, $data);
3925 3925
         $this->requestSOAP = $data;
3926 3926
         $this->debug('leaving parse_request');
@@ -4439,7 +4439,7 @@  discard block
 block discarded – undo
4439 4439
             if (null !== $_SERVER) {
4440 4440
                 $SERVER_NAME = $_SERVER['SERVER_NAME'];
4441 4441
                 $SCRIPT_NAME = isset($_SERVER['PHP_SELF']) ? $_SERVER['PHP_SELF'] : $_SERVER['SCRIPT_NAME'];
4442
-                $HTTPS = isset($_SERVER['HTTPS']) ? : 'off';
4442
+                $HTTPS = isset($_SERVER['HTTPS']) ?: 'off';
4443 4443
             } else {
4444 4444
                 $this->setError(' _SERVER  is not available');
4445 4445
             }
@@ -4563,7 +4563,7 @@  discard block
 block discarded – undo
4563 4563
             'transport' => $transport,
4564 4564
             'portType'  => $serviceName . 'PortType',
4565 4565
         ];
4566
-        $this->wsdl->ports[$serviceName . 'Port']                                                                = [
4566
+        $this->wsdl->ports[$serviceName . 'Port'] = [
4567 4567
             'binding'     => $serviceName . 'Binding',
4568 4568
             'location'    => $endpoint,
4569 4569
             'bindingType' => 'http://schemas.xmlsoap.org/wsdl/soap/',
@@ -4621,13 +4621,13 @@  discard block
 block discarded – undo
4621 4621
     public $proxypassword    = '';
4622 4622
     public $timeout          = 0;
4623 4623
     public $response_timeout = 30;
4624
-    public $curl_options     = [];    // User-specified cURL options
4625
-    public $use_curl         = false;            // whether to always try to use cURL
4624
+    public $curl_options     = []; // User-specified cURL options
4625
+    public $use_curl         = false; // whether to always try to use cURL
4626 4626
     // for HTTP authentication
4627
-    public $username    = '';                // Username for HTTP authentication
4628
-    public $password    = '';                // Password for HTTP authentication
4629
-    public $authtype    = '';                // Type of HTTP authentication
4630
-    public $certRequest = [];        // Certificate for HTTP SSL authentication
4627
+    public $username    = ''; // Username for HTTP authentication
4628
+    public $password    = ''; // Password for HTTP authentication
4629
+    public $authtype    = ''; // Type of HTTP authentication
4630
+    public $certRequest = []; // Certificate for HTTP SSL authentication
4631 4631
 
4632 4632
     /**
4633 4633
      * Constructor
@@ -4681,7 +4681,7 @@  discard block
 block discarded – undo
4681 4681
             // Schema imports
4682 4682
             foreach ($this->schemas as $ns => $list) {
4683 4683
                 foreach ($list as $xs) {
4684
-                    $wsdlparts = parse_url($this->wsdl);    // this is bogusly simple!
4684
+                    $wsdlparts = parse_url($this->wsdl); // this is bogusly simple!
4685 4685
                     foreach ($xs->imports as $ns2 => $list2) {
4686 4686
                         for ($ii = 0, $iiMax = count($list2); $ii < $iiMax; ++$ii) {
4687 4687
                             if (!$list2[$ii]['loaded']) {
@@ -4706,7 +4706,7 @@  discard block
 block discarded – undo
4706 4706
                 }
4707 4707
             }
4708 4708
             // WSDL imports
4709
-            $wsdlparts = parse_url($this->wsdl);    // this is bogusly simple!
4709
+            $wsdlparts = parse_url($this->wsdl); // this is bogusly simple!
4710 4710
             foreach ($this->import as $ns => $list) {
4711 4711
                 for ($ii = 0, $iiMax = count($list); $ii < $iiMax; ++$ii) {
4712 4712
                     if (!$list[$ii]['loaded']) {
@@ -5574,12 +5574,12 @@  discard block
 block discarded – undo
5574 5574
                 foreach ($attrs['operations'] as $opName => $opParts) {
5575 5575
                     $binding_xml .= "\n" . '  <operation name="' . $opName . '">';
5576 5576
                     $binding_xml .= "\n" . '    <soap:operation soapAction="' . $opParts['soapAction'] . '" style="' . $opParts['style'] . '">';
5577
-                    $enc_style   = '';
5577
+                    $enc_style = '';
5578 5578
                     if (isset($opParts['input']['encodingStyle']) && '' !== $opParts['input']['encodingStyle']) {
5579 5579
                         $enc_style = ' encodingStyle="' . $opParts['input']['encodingStyle'] . '"';
5580 5580
                     }
5581 5581
                     $binding_xml .= "\n" . '    <input><soap:body use="' . $opParts['input']['use'] . '" namespace="' . $opParts['input']['namespace'] . '"' . $enc_style . '></input>';
5582
-                    $enc_style   = '';
5582
+                    $enc_style = '';
5583 5583
                     if (isset($opParts['output']['encodingStyle']) && '' !== $opParts['output']['encodingStyle']) {
5584 5584
                         $enc_style = ' encodingStyle="' . $opParts['output']['encodingStyle'] . '"';
5585 5585
                     }
@@ -6548,7 +6548,7 @@  discard block
 block discarded – undo
6548 6548
     public $root_struct_name      = '';
6549 6549
     public $root_struct_namespace = '';
6550 6550
     public $root_header           = '';
6551
-    public $document              = '';            // incoming SOAP body (text)
6551
+    public $document              = ''; // incoming SOAP body (text)
6552 6552
     // determines where in the message we are (envelope,header,body,method)
6553 6553
     public $status            = '';
6554 6554
     public $position          = 0;
@@ -6563,9 +6563,9 @@  discard block
 block discarded – undo
6563 6563
     public $fault_detail    = '';
6564 6564
     public $depth_array     = [];
6565 6565
     public $debug_flag      = true;
6566
-    public $soapresponse;    // parsed SOAP Body
6567
-    public $soapheader;        // parsed SOAP Header
6568
-    public $responseHeaders = '';    // incoming SOAP headers (text)
6566
+    public $soapresponse; // parsed SOAP Body
6567
+    public $soapheader; // parsed SOAP Header
6568
+    public $responseHeaders = ''; // incoming SOAP headers (text)
6569 6569
     public $body_position   = 0;
6570 6570
     // for multiref parsing:
6571 6571
     // array of id => pos
@@ -7007,20 +7007,20 @@  discard block
 block discarded – undo
7007 7007
     {
7008 7008
         // TODO: use the namespace!
7009 7009
         if (!isset($type) || 'string' === $type || 'long' === $type || 'unsignedLong' === $type) {
7010
-            return (string)$value;
7010
+            return (string) $value;
7011 7011
         }
7012 7012
         if ('int' === $type || 'integer' === $type || 'short' === $type || 'byte' === $type) {
7013
-            return (int)$value;
7013
+            return (int) $value;
7014 7014
         }
7015 7015
         if ('float' === $type || 'double' === $type || 'decimal' === $type) {
7016
-            return (float)$value;
7016
+            return (float) $value;
7017 7017
         }
7018 7018
         if ('boolean' === $type) {
7019 7019
             if ('false' === mb_strtolower($value) || 'f' === mb_strtolower($value)) {
7020 7020
                 return false;
7021 7021
             }
7022 7022
 
7023
-            return (bool)$value;
7023
+            return (bool) $value;
7024 7024
         }
7025 7025
         if ('base64' === $type || 'base64Binary' === $type) {
7026 7026
             $this->debug('Decode base64 value');
@@ -7029,14 +7029,14 @@  discard block
 block discarded – undo
7029 7029
         }
7030 7030
         // obscure numeric types
7031 7031
         if ('nonPositiveInteger' === $type || 'negativeInteger' === $type || 'nonNegativeInteger' === $type || 'positiveInteger' === $type || 'unsignedInt' === $type || 'unsignedShort' === $type || 'unsignedByte' === $type) {
7032
-            return (int)$value;
7032
+            return (int) $value;
7033 7033
         }
7034 7034
         // bogus: parser treats array with no elements as a simple type
7035 7035
         if ('array' === $type) {
7036 7036
             return [];
7037 7037
         }
7038 7038
         // everything else
7039
-        return (string)$value;
7039
+        return (string) $value;
7040 7040
     }
7041 7041
 
7042 7042
     /**
@@ -7185,37 +7185,37 @@  discard block
 block discarded – undo
7185 7185
  */
7186 7186
 class Nusoap_client extends Nusoap_base
7187 7187
 {
7188
-    public $username             = '';                // Username for HTTP authentication
7189
-    public $password             = '';                // Password for HTTP authentication
7190
-    public $authtype             = '';                // Type of HTTP authentication
7191
-    public $certRequest          = [];        // Certificate for HTTP SSL authentication
7192
-    public $requestHeaders       = false;    // SOAP headers in request (text)
7193
-    public $responseHeaders      = '';        // SOAP headers from response (incomplete namespace resolution) (text)
7194
-    public $responseHeader;        // SOAP Header from response (parsed)
7195
-    public $document             = '';                // SOAP body response portion (incomplete namespace resolution) (text)
7188
+    public $username             = ''; // Username for HTTP authentication
7189
+    public $password             = ''; // Password for HTTP authentication
7190
+    public $authtype             = ''; // Type of HTTP authentication
7191
+    public $certRequest          = []; // Certificate for HTTP SSL authentication
7192
+    public $requestHeaders       = false; // SOAP headers in request (text)
7193
+    public $responseHeaders      = ''; // SOAP headers from response (incomplete namespace resolution) (text)
7194
+    public $responseHeader; // SOAP Header from response (parsed)
7195
+    public $document             = ''; // SOAP body response portion (incomplete namespace resolution) (text)
7196 7196
     public $endpoint;
7197
-    public $forceEndpoint        = '';        // overrides WSDL endpoint
7197
+    public $forceEndpoint        = ''; // overrides WSDL endpoint
7198 7198
     public $proxyhost            = '';
7199 7199
     public $proxyport            = '';
7200 7200
     public $proxyusername        = '';
7201 7201
     public $proxypassword        = '';
7202
-    public $portName             = '';                // port name to use in WSDL
7203
-    public $xml_encoding         = '';            // character set encoding of incoming (response) messages
7202
+    public $portName             = ''; // port name to use in WSDL
7203
+    public $xml_encoding         = ''; // character set encoding of incoming (response) messages
7204 7204
     public $http_encoding        = false;
7205
-    public $timeout              = 0;                // HTTP connection timeout
7206
-    public $response_timeout     = 30;        // HTTP response timeout
7207
-    public $endpointType         = '';            // soap|wsdl, empty for WSDL initialization error
7205
+    public $timeout              = 0; // HTTP connection timeout
7206
+    public $response_timeout     = 30; // HTTP response timeout
7207
+    public $endpointType         = ''; // soap|wsdl, empty for WSDL initialization error
7208 7208
     public $persistentConnection = false;
7209
-    public $defaultRpcParams     = false;    // This is no longer used
7210
-    public $request              = '';                // HTTP request
7211
-    public $response             = '';                // HTTP response
7212
-    public $responseData         = '';            // SOAP payload of response
7213
-    public $cookies              = [];            // Cookies from response or for request
7214
-    public $decode_utf8          = true;        // toggles whether the parser decodes element content w/ utf8_decode()
7215
-    public $operations           = [];        // WSDL operations, empty for WSDL initialization error
7216
-    public $curl_options         = [];    // User-specified cURL options
7217
-    public $bindingType          = '';            // WSDL operation binding type
7218
-    public $use_curl             = false;            // whether to always try to use cURL
7209
+    public $defaultRpcParams     = false; // This is no longer used
7210
+    public $request              = ''; // HTTP request
7211
+    public $response             = ''; // HTTP response
7212
+    public $responseData         = ''; // SOAP payload of response
7213
+    public $cookies              = []; // Cookies from response or for request
7214
+    public $decode_utf8          = true; // toggles whether the parser decodes element content w/ utf8_decode()
7215
+    public $operations           = []; // WSDL operations, empty for WSDL initialization error
7216
+    public $curl_options         = []; // User-specified cURL options
7217
+    public $bindingType          = ''; // WSDL operation binding type
7218
+    public $use_curl             = false; // whether to always try to use cURL
7219 7219
 
7220 7220
     /*
7221 7221
      * Fault related variables
@@ -7941,7 +7941,7 @@  discard block
 block discarded – undo
7941 7941
                     $paramCommentStr = 'void';
7942 7942
                 }
7943 7943
                 $opData['namespace'] = !isset($opData['namespace']) ? 'http://testuri.com' : $opData['namespace'];
7944
-                $evalStr             .= "// $paramCommentStr
7944
+                $evalStr .= "// $paramCommentStr
7945 7945
 	function " . str_replace('.', '__', $operation) . "($paramStr) {
7946 7946
 		\$params = array($paramArrayStr);
7947 7947
 		return \$this->call('$operation', \$params, '" . $opData['namespace'] . "', '" . (isset($opData['soapAction']) ? $opData['soapAction'] : '') . "');
Please login to merge, or discard this patch.