@@ -22,7 +22,7 @@ |
||
| 22 | 22 | { |
| 23 | 23 | public static function info($code) |
| 24 | 24 | { |
| 25 | - $codes = (array) json_decode(file_get_contents(__DIR__.'/httpcodes.json'), true); |
|
| 25 | + $codes = (array) json_decode(file_get_contents(__DIR__ . '/httpcodes.json'), true); |
|
| 26 | 26 | if (array_key_exists($code, $codes)) { |
| 27 | 27 | return $codes[$code]; |
| 28 | 28 | } |
@@ -39,7 +39,7 @@ |
||
| 39 | 39 | * @param string $url |
| 40 | 40 | * @param string $action |
| 41 | 41 | * @param string $envelope |
| 42 | - * @param array $parameters |
|
| 42 | + * @param string[] $parameters |
|
| 43 | 43 | * |
| 44 | 44 | * @return string |
| 45 | 45 | * @throws \NFePHP\Common\Exception\SoapException |
@@ -66,20 +66,20 @@ discard block |
||
| 66 | 66 | curl_setopt($oCurl, CURLOPT_HEADER, 1); |
| 67 | 67 | curl_setopt($oCurl, CURLOPT_SSL_VERIFYHOST, 0); |
| 68 | 68 | curl_setopt($oCurl, CURLOPT_SSL_VERIFYPEER, 0); |
| 69 | - if (! $this->disablesec) { |
|
| 69 | + if (!$this->disablesec) { |
|
| 70 | 70 | curl_setopt($oCurl, CURLOPT_SSL_VERIFYHOST, 2); |
| 71 | 71 | if (is_file($this->casefaz)) { |
| 72 | 72 | curl_setopt($oCurl, CURLOPT_CAINFO, $this->casefaz); |
| 73 | 73 | } |
| 74 | 74 | } |
| 75 | 75 | curl_setopt($oCurl, CURLOPT_SSLVERSION, $this->soapprotocol); |
| 76 | - curl_setopt($oCurl, CURLOPT_SSLCERT, $this->tempdir.$this->certfile); |
|
| 77 | - curl_setopt($oCurl, CURLOPT_SSLKEY, $this->tempdir.$this->prifile); |
|
| 78 | - if (! empty($this->temppass)) { |
|
| 76 | + curl_setopt($oCurl, CURLOPT_SSLCERT, $this->tempdir . $this->certfile); |
|
| 77 | + curl_setopt($oCurl, CURLOPT_SSLKEY, $this->tempdir . $this->prifile); |
|
| 78 | + if (!empty($this->temppass)) { |
|
| 79 | 79 | curl_setopt($oCurl, CURLOPT_KEYPASSWD, $this->temppass); |
| 80 | 80 | } |
| 81 | 81 | curl_setopt($oCurl, CURLOPT_RETURNTRANSFER, true); |
| 82 | - if (! empty($envelope)) { |
|
| 82 | + if (!empty($envelope)) { |
|
| 83 | 83 | curl_setopt($oCurl, CURLOPT_POST, true); |
| 84 | 84 | curl_setopt($oCurl, CURLOPT_POSTFIELDS, $envelope); |
| 85 | 85 | curl_setopt($oCurl, CURLOPT_HTTPHEADER, $parameters); |
@@ -97,14 +97,14 @@ discard block |
||
| 97 | 97 | $this->responseBody = trim(substr($response, $headsize)); |
| 98 | 98 | $this->saveDebugFiles( |
| 99 | 99 | $operation, |
| 100 | - $this->requestHead."\n".$this->requestBody, |
|
| 101 | - $this->responseHead."\n".$this->responseBody |
|
| 100 | + $this->requestHead . "\n" . $this->requestBody, |
|
| 101 | + $this->responseHead . "\n" . $this->responseBody |
|
| 102 | 102 | ); |
| 103 | 103 | } catch (\Exception $e) { |
| 104 | 104 | throw SoapException::unableToLoadCurl($e->getMessage()); |
| 105 | 105 | } |
| 106 | 106 | if ($this->soaperror != '') { |
| 107 | - throw SoapException::soapFault($this->soaperror." [$url]"); |
|
| 107 | + throw SoapException::soapFault($this->soaperror . " [$url]"); |
|
| 108 | 108 | } |
| 109 | 109 | if ($httpcode != 200) { |
| 110 | 110 | throw SoapException::soapFault( |
@@ -126,9 +126,9 @@ discard block |
||
| 126 | 126 | if ($this->proxyIP != '') { |
| 127 | 127 | curl_setopt($oCurl, CURLOPT_HTTPPROXYTUNNEL, 1); |
| 128 | 128 | curl_setopt($oCurl, CURLOPT_PROXYTYPE, CURLPROXY_HTTP); |
| 129 | - curl_setopt($oCurl, CURLOPT_PROXY, $this->proxyIP.':'.$this->proxyPort); |
|
| 129 | + curl_setopt($oCurl, CURLOPT_PROXY, $this->proxyIP . ':' . $this->proxyPort); |
|
| 130 | 130 | if ($this->proxyUser != '') { |
| 131 | - curl_setopt($oCurl, CURLOPT_PROXYUSERPWD, $this->proxyUser.':'.$this->proxyPass); |
|
| 131 | + curl_setopt($oCurl, CURLOPT_PROXYUSERPWD, $this->proxyUser . ':' . $this->proxyPass); |
|
| 132 | 132 | curl_setopt($oCurl, CURLOPT_PROXYAUTH, CURLAUTH_BASIC); |
| 133 | 133 | } |
| 134 | 134 | } |
@@ -151,10 +151,10 @@ discard block |
||
| 151 | 151 | $dom->preserveWhiteSpace = false; |
| 152 | 152 | $dom->loadXML($body); |
| 153 | 153 | $faultstring = ''; |
| 154 | - $nodefault = ! empty($dom->getElementsByTagName('faultstring')->item(0)) |
|
| 154 | + $nodefault = !empty($dom->getElementsByTagName('faultstring')->item(0)) |
|
| 155 | 155 | ? $dom->getElementsByTagName('faultstring')->item(0) |
| 156 | 156 | : ''; |
| 157 | - if (! empty($nodefault)) { |
|
| 157 | + if (!empty($nodefault)) { |
|
| 158 | 158 | $faultstring = $nodefault->nodeValue; |
| 159 | 159 | } |
| 160 | 160 | |
@@ -172,7 +172,7 @@ discard block |
||
| 172 | 172 | { |
| 173 | 173 | $response = ''; |
| 174 | 174 | $this->saveTemporarilyKeyFiles(); |
| 175 | - $url .= '?WSDL'; |
|
| 175 | + $url .= '?WSDL'; |
|
| 176 | 176 | $oCurl = curl_init(); |
| 177 | 177 | curl_setopt($oCurl, CURLOPT_URL, $url); |
| 178 | 178 | curl_setopt($oCurl, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4); |
@@ -181,9 +181,9 @@ discard block |
||
| 181 | 181 | curl_setopt($oCurl, CURLOPT_SSL_VERIFYHOST, 0); |
| 182 | 182 | curl_setopt($oCurl, CURLOPT_SSL_VERIFYPEER, 0); |
| 183 | 183 | curl_setopt($oCurl, CURLOPT_SSLVERSION, $this->soapprotocol); |
| 184 | - curl_setopt($oCurl, CURLOPT_SSLCERT, $this->tempdir.$this->certfile); |
|
| 185 | - curl_setopt($oCurl, CURLOPT_SSLKEY, $this->tempdir.$this->prifile); |
|
| 186 | - if (! empty($this->temppass)) { |
|
| 184 | + curl_setopt($oCurl, CURLOPT_SSLCERT, $this->tempdir . $this->certfile); |
|
| 185 | + curl_setopt($oCurl, CURLOPT_SSLKEY, $this->tempdir . $this->prifile); |
|
| 186 | + if (!empty($this->temppass)) { |
|
| 187 | 187 | curl_setopt($oCurl, CURLOPT_KEYPASSWD, $this->temppass); |
| 188 | 188 | } |
| 189 | 189 | curl_setopt($oCurl, CURLOPT_RETURNTRANSFER, true); |
@@ -38,6 +38,7 @@ discard block |
||
| 38 | 38 | /** |
| 39 | 39 | * |
| 40 | 40 | * @param Certificate $certificate |
| 41 | + * @return void |
|
| 41 | 42 | */ |
| 42 | 43 | public function loadCertificate(Certificate $certificate); |
| 43 | 44 | |
@@ -45,6 +46,7 @@ discard block |
||
| 45 | 46 | * Set logger class |
| 46 | 47 | * |
| 47 | 48 | * @param LoggerInterface $logger |
| 49 | + * @return LoggerInterface |
|
| 48 | 50 | */ |
| 49 | 51 | public function loadLogger(LoggerInterface $logger); |
| 50 | 52 | |
@@ -52,6 +54,7 @@ discard block |
||
| 52 | 54 | * Set timeout for connection |
| 53 | 55 | * |
| 54 | 56 | * @param int $timesecs |
| 57 | + * @return integer |
|
| 55 | 58 | */ |
| 56 | 59 | public function timeout($timesecs); |
| 57 | 60 | |
@@ -59,6 +62,7 @@ discard block |
||
| 59 | 62 | * Set security protocol for soap communications |
| 60 | 63 | * |
| 61 | 64 | * @param int $protocol |
| 65 | + * @return integer |
|
| 62 | 66 | */ |
| 63 | 67 | public function protocol($protocol = self::SSL_DEFAULT); |
| 64 | 68 | |
@@ -69,6 +73,7 @@ discard block |
||
| 69 | 73 | * @param int $port |
| 70 | 74 | * @param string $user |
| 71 | 75 | * @param string $password |
| 76 | + * @return void |
|
| 72 | 77 | */ |
| 73 | 78 | public function proxy($ip, $port, $user, $password); |
| 74 | 79 | |
@@ -80,7 +85,6 @@ discard block |
||
| 80 | 85 | * @param string $action |
| 81 | 86 | * @param string $envelope |
| 82 | 87 | * @param array $parameters |
| 83 | - * @param string $request |
|
| 84 | 88 | */ |
| 85 | 89 | public function send( |
| 86 | 90 | $operation, |
@@ -65,7 +65,7 @@ |
||
| 65 | 65 | */ |
| 66 | 66 | protected function toNode() |
| 67 | 67 | { |
| 68 | - $evtid = FactoryId::build( |
|
| 68 | + $evtid = FactoryId::build( |
|
| 69 | 69 | $this->tpInsc, |
| 70 | 70 | $this->nrInsc, |
| 71 | 71 | $this->date, |
@@ -65,7 +65,7 @@ |
||
| 65 | 65 | */ |
| 66 | 66 | protected function toNode() |
| 67 | 67 | { |
| 68 | - $evtid = FactoryId::build( |
|
| 68 | + $evtid = FactoryId::build( |
|
| 69 | 69 | $this->tpInsc, |
| 70 | 70 | $this->nrInsc, |
| 71 | 71 | $this->date, |
@@ -65,7 +65,7 @@ |
||
| 65 | 65 | */ |
| 66 | 66 | protected function toNode() |
| 67 | 67 | { |
| 68 | - $evtid = FactoryId::build( |
|
| 68 | + $evtid = FactoryId::build( |
|
| 69 | 69 | $this->tpInsc, |
| 70 | 70 | $this->nrInsc, |
| 71 | 71 | $this->date, |
@@ -65,7 +65,7 @@ |
||
| 65 | 65 | */ |
| 66 | 66 | protected function toNode() |
| 67 | 67 | { |
| 68 | - $evtid = FactoryId::build( |
|
| 68 | + $evtid = FactoryId::build( |
|
| 69 | 69 | $this->tpInsc, |
| 70 | 70 | $this->nrInsc, |
| 71 | 71 | $this->date, |
@@ -65,7 +65,7 @@ |
||
| 65 | 65 | */ |
| 66 | 66 | protected function toNode() |
| 67 | 67 | { |
| 68 | - $evtid = FactoryId::build( |
|
| 68 | + $evtid = FactoryId::build( |
|
| 69 | 69 | $this->tpInsc, |
| 70 | 70 | $this->nrInsc, |
| 71 | 71 | $this->date, |
@@ -65,7 +65,7 @@ |
||
| 65 | 65 | */ |
| 66 | 66 | protected function toNode() |
| 67 | 67 | { |
| 68 | - $evtid = FactoryId::build( |
|
| 68 | + $evtid = FactoryId::build( |
|
| 69 | 69 | $this->tpInsc, |
| 70 | 70 | $this->nrInsc, |
| 71 | 71 | $this->date, |