From 27da8156dcc91501edba81946f23cbbc228bdc44 Mon Sep 17 00:00:00 2001 From: robmachado Date: Thu, 21 Dec 2017 08:57:35 -0200 Subject: [PATCH 1/2] [UPD] SoapBase spaces adjust and inclusion PHP7.2 --- .travis.yml | 1 + composer.json | 2 +- src/Soap/SoapBase.php | 14 +++++++------- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index 78f42a7d..7ece8c47 100755 --- a/.travis.yml +++ b/.travis.yml @@ -4,6 +4,7 @@ php: - 5.6 - 7.0 - 7.1 + - 7.2 # This triggers builds to run on the new TravisCI infrastructure. # See: http://docs.travis-ci.com/user/workers/container-based-infrastructure/ diff --git a/composer.json b/composer.json index 2bfbc4a3..2add96f3 100755 --- a/composer.json +++ b/composer.json @@ -26,7 +26,7 @@ } ], "require": { - "php": "^5.6 || ^7.0", + "php": ">=5.6", "ext-dom": "*", "ext-curl": "*", "ext-soap": "*", diff --git a/src/Soap/SoapBase.php b/src/Soap/SoapBase.php index 0c97d3d5..9337ac0e 100644 --- a/src/Soap/SoapBase.php +++ b/src/Soap/SoapBase.php @@ -399,7 +399,7 @@ private function mountEnvelopString( $bodyContent = '' ) { return sprintf( - '<%s:Envelope %s>'.$header.'<%s:Body>%s', + '<%s:Envelope %s>' . $header . '<%s:Body>%s', $envelopPrefix, $envelopAttributes, $envelopPrefix, @@ -422,7 +422,7 @@ private function mountSoapHeaders($envelopPrefix, $header = null) } $headerItems = ''; foreach ($header->data as $key => $value) { - $headerItems .= '<'.$key.'>'.$value.''; + $headerItems .= '<' . $key . '>' . $value . ''; } return sprintf( '<%s:Header><%s xmlns="%s">%s', @@ -444,7 +444,7 @@ private function getStringAttributes($namespaces = []) { $envelopeAttributes = ''; foreach ($namespaces as $key => $value) { - $envelopeAttributes = $key.'="'.$value.'"'; + $envelopeAttributes = $key . '="' . $value . '"'; } return $envelopeAttributes; } @@ -462,9 +462,9 @@ public function saveTemporarilyKeyFiles() ); } $this->certsdir = $this->certificate->getCnpj() . '/certs/'; - $this->prifile = $this->certsdir. Strings::randomString(10).'.pem'; - $this->pubfile = $this->certsdir . Strings::randomString(10).'.pem'; - $this->certfile = $this->certsdir . Strings::randomString(10).'.pem'; + $this->prifile = $this->certsdir . Strings::randomString(10) . '.pem'; + $this->pubfile = $this->certsdir . Strings::randomString(10) . '.pem'; + $this->certfile = $this->certsdir . Strings::randomString(10) . '.pem'; $ret = true; $private = $this->certificate->privateKey; if ($this->encriptPrivateKey) { @@ -516,7 +516,7 @@ public function removeTemporarilyFiles() //utilize a API. Outra solução para remover arquivos "perdidos" pode ser //encontrada oportunamente. $dt = new \DateTime(); - $tint = new \DateInterval("PT".$this->waitingTime."M"); + $tint = new \DateInterval("PT" . $this->waitingTime . "M"); $tint->invert = 1; $tsLimit = $dt->add($tint)->getTimestamp(); foreach ($contents as $item) { From 8b0d27531b7d498da06e3936914ede2d98faa5ba Mon Sep 17 00:00:00 2001 From: robmachado Date: Thu, 21 Dec 2017 09:06:07 -0200 Subject: [PATCH 2/2] [UPD] SoapCurl spaces adjustments --- src/Soap/SoapCurl.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Soap/SoapCurl.php b/src/Soap/SoapCurl.php index 04ec1909..6d21b695 100644 --- a/src/Soap/SoapCurl.php +++ b/src/Soap/SoapCurl.php @@ -139,9 +139,9 @@ private function setCurlProxy(&$oCurl) if ($this->proxyIP != '') { curl_setopt($oCurl, CURLOPT_HTTPPROXYTUNNEL, 1); curl_setopt($oCurl, CURLOPT_PROXYTYPE, CURLPROXY_HTTP); - curl_setopt($oCurl, CURLOPT_PROXY, $this->proxyIP.':'.$this->proxyPort); + curl_setopt($oCurl, CURLOPT_PROXY, $this->proxyIP . ':' . $this->proxyPort); if ($this->proxyUser != '') { - curl_setopt($oCurl, CURLOPT_PROXYUSERPWD, $this->proxyUser.':'.$this->proxyPass); + curl_setopt($oCurl, CURLOPT_PROXYUSERPWD, $this->proxyUser . ':' . $this->proxyPass); curl_setopt($oCurl, CURLOPT_PROXYAUTH, CURLAUTH_BASIC); } }