@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | * @param string $priKeyPath path para a chave privada |
91 | 91 | * @param string $pubKeyPath path para a chave publica |
92 | 92 | * @param string $certKeyPath path para o certificado |
93 | - * @param string $timeout tempo de espera da resposta do webservice |
|
93 | + * @param integer $timeout tempo de espera da resposta do webservice |
|
94 | 94 | * @param integer $sslProtocol |
95 | 95 | */ |
96 | 96 | public function __construct($priKeyPath = '', $pubKeyPath = '', $certKeyPath = '', $timeout = 10, $sslProtocol = 0) |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | * @param string $port numero da porta usada pelo proxy |
118 | 118 | * @param string $user nome do usuário do proxy |
119 | 119 | * @param string $pass senha de acesso ao proxy |
120 | - * @return boolean |
|
120 | + * @return boolean|null |
|
121 | 121 | */ |
122 | 122 | public function setProxy($ipNumber, $port, $user = '', $pass = '') |
123 | 123 | { |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | |
144 | 144 | /** |
145 | 145 | * Envia mensagem ao webservice |
146 | - * @param string $urlsevice |
|
146 | + * @param string $urlservice |
|
147 | 147 | * @param string $namespace |
148 | 148 | * @param string $header |
149 | 149 | * @param string $body |
@@ -216,8 +216,8 @@ discard block |
||
216 | 216 | /** |
217 | 217 | * getWsdl |
218 | 218 | * Baixa o arquivo wsdl do webservice |
219 | - * @param string $urlsefaz |
|
220 | - * @return boolean|string |
|
219 | + * @param string $urlservice |
|
220 | + * @return false|string |
|
221 | 221 | */ |
222 | 222 | public function getWsdl($urlservice) |
223 | 223 | { |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | throw new Exception\InvalidArgumentException($msg); |
105 | 105 | } |
106 | 106 | $this->sslProtocol = $sslProtocol; |
107 | - if (! is_file($priKeyPath) || ! is_file($pubKeyPath) || ! is_file($certKeyPath) || ! is_numeric($timeout)) { |
|
107 | + if (!is_file($priKeyPath) || !is_file($pubKeyPath) || !is_file($certKeyPath) || !is_numeric($timeout)) { |
|
108 | 108 | $msg = "Alguns dos certificados não foram encontrados ou o timeout pode não ser numérico."; |
109 | 109 | throw new Exception\InvalidArgumentException($msg); |
110 | 110 | } |
@@ -153,12 +153,12 @@ discard block |
||
153 | 153 | public function send($urlservice, $namespace, $header, $body, $method) |
154 | 154 | { |
155 | 155 | //monta a mensagem ao webservice |
156 | - $data = '<?xml version="1.0" encoding="utf-8"?>'.'<soap12:Envelope '; |
|
156 | + $data = '<?xml version="1.0" encoding="utf-8"?>' . '<soap12:Envelope '; |
|
157 | 157 | $data .= 'xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" '; |
158 | 158 | $data .= 'xmlns:xsd="http://www.w3.org/2001/XMLSchema" '; |
159 | 159 | $data .= 'xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">'; |
160 | - $data .= '<soap12:Header>'.$header.'</soap12:Header>'; |
|
161 | - $data .= '<soap12:Body>'.$body.'</soap12:Body>'; |
|
160 | + $data .= '<soap12:Header>' . $header . '</soap12:Header>'; |
|
161 | + $data .= '<soap12:Body>' . $body . '</soap12:Body>'; |
|
162 | 162 | $data .= '</soap12:Envelope>'; |
163 | 163 | $data = Strings::clearMsg($data); |
164 | 164 | $this->lastMsg = $data; |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | // "Content-length: $tamanho"); |
172 | 172 | $parametros = array( |
173 | 173 | 'Content-Type: application/soap+xml;charset=utf-8', |
174 | - 'SOAPAction: "'.$method.'"', |
|
174 | + 'SOAPAction: "' . $method . '"', |
|
175 | 175 | "Content-length: $tamanho"); |
176 | 176 | //solicita comunicação via cURL |
177 | 177 | $resposta = $this->zCommCurl($urlservice, $data, $parametros); |
@@ -193,12 +193,12 @@ discard block |
||
193 | 193 | $xPos = stripos($resposta, "<"); |
194 | 194 | //se não existir não é um xml nem um html |
195 | 195 | if ($xPos !== false) { |
196 | - $xml = substr($resposta, $xPos, $lenresp-$xPos); |
|
196 | + $xml = substr($resposta, $xPos, $lenresp - $xPos); |
|
197 | 197 | } else { |
198 | 198 | $xml = ''; |
199 | 199 | } |
200 | 200 | //testa para saber se é um xml mesmo ou é um html |
201 | - $result = simplexml_load_string($xml, 'SimpleXmlElement', LIBXML_NOERROR+LIBXML_ERR_FATAL+LIBXML_ERR_NONE); |
|
201 | + $result = simplexml_load_string($xml, 'SimpleXmlElement', LIBXML_NOERROR + LIBXML_ERR_FATAL + LIBXML_ERR_NONE); |
|
202 | 202 | if ($result === false) { |
203 | 203 | //não é um xml então pode limpar |
204 | 204 | $xml = ''; |
@@ -208,7 +208,7 @@ discard block |
||
208 | 208 | throw new Exception\RuntimeException($msg); |
209 | 209 | } |
210 | 210 | if ($xml != '' && substr($xml, 0, 5) != '<?xml') { |
211 | - $xml = '<?xml version="1.0" encoding="utf-8"?>'.$xml; |
|
211 | + $xml = '<?xml version="1.0" encoding="utf-8"?>' . $xml; |
|
212 | 212 | } |
213 | 213 | return $xml; |
214 | 214 | } //fim send |
@@ -235,7 +235,7 @@ discard block |
||
235 | 235 | //não retornou um wsdl |
236 | 236 | return false; |
237 | 237 | } |
238 | - $wsdl = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n".trim(substr($resposta, $nPos)); |
|
238 | + $wsdl = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" . trim(substr($resposta, $nPos)); |
|
239 | 239 | return $wsdl; |
240 | 240 | } |
241 | 241 | |
@@ -255,9 +255,9 @@ discard block |
||
255 | 255 | if ($this->proxyIP != '') { |
256 | 256 | curl_setopt($oCurl, CURLOPT_HTTPPROXYTUNNEL, 1); |
257 | 257 | curl_setopt($oCurl, CURLOPT_PROXYTYPE, CURLPROXY_HTTP); |
258 | - curl_setopt($oCurl, CURLOPT_PROXY, $this->proxyIP.':'.$this->proxyPORT); |
|
258 | + curl_setopt($oCurl, CURLOPT_PROXY, $this->proxyIP . ':' . $this->proxyPORT); |
|
259 | 259 | if ($this->proxyPASS != '') { |
260 | - curl_setopt($oCurl, CURLOPT_PROXYUSERPWD, $this->proxyUSER.':'.$this->proxyPASS); |
|
260 | + curl_setopt($oCurl, CURLOPT_PROXYUSERPWD, $this->proxyUSER . ':' . $this->proxyPASS); |
|
261 | 261 | curl_setopt($oCurl, CURLOPT_PROXYAUTH, CURLAUTH_BASIC); |
262 | 262 | } //fim if senha proxy |
263 | 263 | }//fim if aProxy |
@@ -294,7 +294,7 @@ discard block |
||
294 | 294 | curl_setopt($oCurl, CURLOPT_SSLCERT, $this->certKeyPath); |
295 | 295 | curl_setopt($oCurl, CURLOPT_SSLKEY, $this->priKeyPath); |
296 | 296 | } else { |
297 | - $agent= 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.0.3705; .NET CLR 1.1.4322)'; |
|
297 | + $agent = 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.0.3705; .NET CLR 1.1.4322)'; |
|
298 | 298 | curl_setopt($oCurl, CURLOPT_USERAGENT, $agent); |
299 | 299 | } |
300 | 300 | curl_setopt($oCurl, CURLOPT_RETURNTRANSFER, 1); |
@@ -347,14 +347,14 @@ discard block |
||
347 | 347 | $this->infoCurl["starttransfer_time"] = $info["starttransfer_time"]; |
348 | 348 | $this->infoCurl["redirect_time"] = $info["redirect_time"]; |
349 | 349 | //coloca as informações em uma variável |
350 | - $txtInfo =""; |
|
350 | + $txtInfo = ""; |
|
351 | 351 | foreach ($info as $key => $content) { |
352 | 352 | if (is_string($content)) { |
353 | - $txtInfo .= strtoupper($key).'='.$content."\n"; |
|
353 | + $txtInfo .= strtoupper($key) . '=' . $content . "\n"; |
|
354 | 354 | } |
355 | 355 | } |
356 | 356 | //carrega a variavel debug |
357 | - $this->soapDebug = $data."\n\n".$txtInfo."\n".$resposta; |
|
357 | + $this->soapDebug = $data . "\n\n" . $txtInfo . "\n" . $resposta; |
|
358 | 358 | } |
359 | 359 | |
360 | 360 | /** |
@@ -37,6 +37,9 @@ |
||
37 | 37 | $this->load(); |
38 | 38 | } |
39 | 39 | |
40 | + /** |
|
41 | + * @param string $password |
|
42 | + */ |
|
40 | 43 | private function read($content, $password) |
41 | 44 | { |
42 | 45 | $certs = []; |
@@ -14,12 +14,12 @@ |
||
14 | 14 | |
15 | 15 | class LotNumber |
16 | 16 | { |
17 | - /** |
|
18 | - * geraNumLote |
|
19 | - * Gera numero de lote com base em microtime |
|
20 | - * @param integer $numdigits numero de digitos para o lote |
|
21 | - * @return string |
|
22 | - */ |
|
17 | + /** |
|
18 | + * geraNumLote |
|
19 | + * Gera numero de lote com base em microtime |
|
20 | + * @param integer $numdigits numero de digitos para o lote |
|
21 | + * @return string |
|
22 | + */ |
|
23 | 23 | public static function geraNumLote($numdigits = 15) |
24 | 24 | { |
25 | 25 | return substr(str_replace(',', '', number_format(microtime(true)*1000000, 0)), 0, $numdigits); |
@@ -22,6 +22,6 @@ |
||
22 | 22 | */ |
23 | 23 | public static function geraNumLote($numdigits = 15) |
24 | 24 | { |
25 | - return substr(str_replace(',', '', number_format(microtime(true)*1000000, 0)), 0, $numdigits); |
|
25 | + return substr(str_replace(',', '', number_format(microtime(true) * 1000000, 0)), 0, $numdigits); |
|
26 | 26 | } |
27 | 27 | } |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | if (substr($xmlString, 0, 1) != '<') { |
37 | 37 | throw new Exception\InvalidArgumentException($msg); |
38 | 38 | } |
39 | - if (! $this->loadXML($xmlString, LIBXML_NOBLANKS | LIBXML_NOEMPTYTAG)) { |
|
39 | + if (!$this->loadXML($xmlString, LIBXML_NOBLANKS | LIBXML_NOEMPTYTAG)) { |
|
40 | 40 | throw new Exception\InvalidArgumentException($msg); |
41 | 41 | } |
42 | 42 | } |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | if (empty($node)) { |
78 | 78 | return ''; |
79 | 79 | } |
80 | - $texto = ! empty($node->getElementsByTagName($name)->item(0)->nodeValue) ? |
|
80 | + $texto = !empty($node->getElementsByTagName($name)->item(0)->nodeValue) ? |
|
81 | 81 | $node->getElementsByTagName($name)->item(0)->nodeValue : ''; |
82 | 82 | return html_entity_decode($texto, ENT_QUOTES, 'UTF-8'); |
83 | 83 | } |
@@ -106,9 +106,9 @@ discard block |
||
106 | 106 | public function getChave($nodeName = 'infNFe') |
107 | 107 | { |
108 | 108 | $node = $this->getElementsByTagName($nodeName)->item(0); |
109 | - if (! empty($node)) { |
|
109 | + if (!empty($node)) { |
|
110 | 110 | $chaveId = $node->getAttribute("Id"); |
111 | - $chave = preg_replace('/[^0-9]/', '', $chaveId); |
|
111 | + $chave = preg_replace('/[^0-9]/', '', $chaveId); |
|
112 | 112 | return $chave; |
113 | 113 | } |
114 | 114 | return ''; |
@@ -198,7 +198,7 @@ discard block |
||
198 | 198 | public function addArrayChild(&$parent, $arr) |
199 | 199 | { |
200 | 200 | $num = 0; |
201 | - if (! empty($arr) && ! empty($parent)) { |
|
201 | + if (!empty($arr) && !empty($parent)) { |
|
202 | 202 | foreach ($arr as $node) { |
203 | 203 | $this->appChild($parent, $node, ''); |
204 | 204 | $num++; |
@@ -27,7 +27,7 @@ |
||
27 | 27 | $dom->formatOutput = false; |
28 | 28 | $dom->loadXML($xml, LIBXML_NOBLANKS | LIBXML_NOEMPTYTAG); |
29 | 29 | libxml_clear_errors(); |
30 | - if (! $dom->schemaValidate($xsd)) { |
|
30 | + if (!$dom->schemaValidate($xsd)) { |
|
31 | 31 | $aIntErrors = libxml_get_errors(); |
32 | 32 | foreach ($aIntErrors as $intError) { |
33 | 33 | self::$errors[] = self::zTranslateError($intError->message) . "\n"; |
@@ -27,13 +27,13 @@ discard block |
||
27 | 27 | * @var array |
28 | 28 | */ |
29 | 29 | public static $aRequirements = array( |
30 | - 'PHP' => array('php','','','5.4.0','Versão do PHP'), |
|
31 | - 'cURL'=> array('curl','cURL Information','','7.22.2','mínimo cURL 7.22.2'), |
|
32 | - 'OpenSSL' => array('openssl','OpenSSL Library Version','','','mínimo OpenSSL 1.0'), |
|
33 | - 'DOM' => array('dom','libxml Version','','2.0.6','mínimo DOM 2.0.6'), |
|
34 | - 'GD' => array('gd','GD Support','','','-----'), |
|
35 | - 'SOAP' => array('soap','Soap Client','','','-----'), |
|
36 | - 'ZIP' => array('zip','Zip version', '', '', '-----') |
|
30 | + 'PHP' => array('php', '', '', '5.4.0', 'Versão do PHP'), |
|
31 | + 'cURL'=> array('curl', 'cURL Information', '', '7.22.2', 'mínimo cURL 7.22.2'), |
|
32 | + 'OpenSSL' => array('openssl', 'OpenSSL Library Version', '', '', 'mínimo OpenSSL 1.0'), |
|
33 | + 'DOM' => array('dom', 'libxml Version', '', '2.0.6', 'mínimo DOM 2.0.6'), |
|
34 | + 'GD' => array('gd', 'GD Support', '', '', '-----'), |
|
35 | + 'SOAP' => array('soap', 'Soap Client', '', '', '-----'), |
|
36 | + 'ZIP' => array('zip', 'Zip version', '', '', '-----') |
|
37 | 37 | ); |
38 | 38 | |
39 | 39 | /** |
@@ -49,12 +49,12 @@ discard block |
||
49 | 49 | $phpver = $modules->convVer($phpversion); |
50 | 50 | $phpvermin = $modules->convVer(self::$aRequirements['PHP'][3]); |
51 | 51 | $status = 'NOK'; |
52 | - $bcor = "bgcolor=\"".self::$cRed."\""; |
|
52 | + $bcor = "bgcolor=\"" . self::$cRed . "\""; |
|
53 | 53 | $comment = "v. $phpversion Inadequada !!!"; |
54 | 54 | if ($phpver >= $phpvermin) { |
55 | - $comment = "mínimo PHP ". self::$aRequirements['PHP'][3]; |
|
55 | + $comment = "mínimo PHP " . self::$aRequirements['PHP'][3]; |
|
56 | 56 | $status = 'OK'; |
57 | - $bcor = "bgcolor=\"".self::$cGreen."\""; |
|
57 | + $bcor = "bgcolor=\"" . self::$cGreen . "\""; |
|
58 | 58 | } |
59 | 59 | $htmmod = "<table><tr bgcolor=\"#FFFF99\">" |
60 | 60 | . "<td>Versão do PHP $phpversion</td>" |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | ); |
74 | 74 | } |
75 | 75 | } |
76 | - return $htmmod.'</table>'; |
|
76 | + return $htmmod . '</table>'; |
|
77 | 77 | } |
78 | 78 | |
79 | 79 | /** |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | $flag = $flag && false; |
93 | 93 | $msg .= "CNPJ incorreto! $cnpj \n"; |
94 | 94 | } |
95 | - if (! is_dir($pathCertsFiles)) { |
|
95 | + if (!is_dir($pathCertsFiles)) { |
|
96 | 96 | $flag = $flag && false; |
97 | 97 | $msg .= "Diretório não localizado! $pathCertsFiles \n"; |
98 | 98 | } |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | } |
102 | 102 | try { |
103 | 103 | $cert = new Pkcs12($pathCertsFiles, $cnpj); |
104 | - $flag = $cert->loadPfxFile($pathCertsFiles.$certPfxName, $certPassword); |
|
104 | + $flag = $cert->loadPfxFile($pathCertsFiles . $certPfxName, $certPassword); |
|
105 | 105 | } catch (InvalidArgumentException $exc) { |
106 | 106 | $flag = false; |
107 | 107 | $msg = $exc->getMessage(); |
@@ -134,12 +134,12 @@ discard block |
||
134 | 134 | $pathcerts = '' |
135 | 135 | ) { |
136 | 136 | $aResp = array( |
137 | - 'NFe' => array('status'=>true,'msg'=>''), |
|
138 | - 'CTe' => array('status'=>true,'msg'=>''), |
|
139 | - 'MDFe' => array('status'=>true,'msg'=>''), |
|
140 | - 'CLe' => array('status'=>true,'msg'=>''), |
|
141 | - 'NFSe' => array('status'=>true,'msg'=>''), |
|
142 | - 'Certs' => array('status'=>true,'msg'=>'') |
|
137 | + 'NFe' => array('status'=>true, 'msg'=>''), |
|
138 | + 'CTe' => array('status'=>true, 'msg'=>''), |
|
139 | + 'MDFe' => array('status'=>true, 'msg'=>''), |
|
140 | + 'CLe' => array('status'=>true, 'msg'=>''), |
|
141 | + 'NFSe' => array('status'=>true, 'msg'=>''), |
|
142 | + 'Certs' => array('status'=>true, 'msg'=>'') |
|
143 | 143 | ); |
144 | 144 | //testa e constroi a estrutura da pasta NFe |
145 | 145 | $aResp['NFe'] = self::zFolderMTest($pathnfe); |
@@ -153,7 +153,7 @@ discard block |
||
153 | 153 | $aResp['NFSe'] = self::zFolderMTest($pathnfse); |
154 | 154 | //testa diretorio certs |
155 | 155 | if ($pathcerts != '') { |
156 | - if (! is_writable($pathcerts)) { |
|
156 | + if (!is_writable($pathcerts)) { |
|
157 | 157 | $aResp['Certs'] = array('status'=>false, 'msg'=>'Diretório sem permissões de escrita'); |
158 | 158 | } |
159 | 159 | } |
@@ -34,13 +34,13 @@ discard block |
||
34 | 34 | for ($i = 1; $i < $count; $i += 2) { |
35 | 35 | if (preg_match('/<h2>([^<]+)<\/h2>/', $vTmp[$i], $vMat)) { |
36 | 36 | $moduleName = trim($vMat[1]); |
37 | - $vTmp2 = explode("\n", $vTmp[$i+1]); |
|
37 | + $vTmp2 = explode("\n", $vTmp[$i + 1]); |
|
38 | 38 | foreach ($vTmp2 as $vOne) { |
39 | 39 | $vPat = '<info>([^<]+)<\/info>'; |
40 | 40 | $vPat3 = "/$vPat\s*$vPat\s*$vPat/"; |
41 | 41 | $vPat2 = "/$vPat\s*$vPat/"; |
42 | 42 | if (preg_match($vPat3, $vOne, $vMat)) { |
43 | - $vModules[$moduleName][trim($vMat[1])] = array(trim($vMat[2]),trim($vMat[3])); |
|
43 | + $vModules[$moduleName][trim($vMat[1])] = array(trim($vMat[2]), trim($vMat[3])); |
|
44 | 44 | } elseif (preg_match($vPat2, $vOne, $vMat)) { |
45 | 45 | $vModules[$moduleName][trim($vMat[1])] = trim($vMat[2]); |
46 | 46 | } |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | $enabled = true; |
79 | 79 | |
80 | 80 | foreach ($aReq as $req) { |
81 | - if (! extension_loaded($req)) { |
|
81 | + if (!extension_loaded($req)) { |
|
82 | 82 | $enabled = ($enabled && false); |
83 | 83 | $lista .= "$req não está carregado no PHP.\n"; |
84 | 84 | } |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | public function getModuleSetting($moduleName, $setting = '') |
112 | 112 | { |
113 | 113 | //verifica se o modulo está carregado antes de continuar |
114 | - if ($this->isLoaded($moduleName)==false) { |
|
114 | + if ($this->isLoaded($moduleName) == false) { |
|
115 | 115 | return 'Modulo não carregado'; |
116 | 116 | } |
117 | 117 | if ($this->list[$moduleName][$setting]) { |
@@ -23,10 +23,10 @@ discard block |
||
23 | 23 | public static function cleanString($texto = '') |
24 | 24 | { |
25 | 25 | $texto = trim($texto); |
26 | - $aFind = array('&','á','à','ã','â','é','ê','í','ó','ô','õ','ú','ü', |
|
27 | - 'ç','Á','À','Ã','Â','É','Ê','Í','Ó','Ô','Õ','Ú','Ü','Ç'); |
|
28 | - $aSubs = array('e','a','a','a','a','e','e','i','o','o','o','u','u', |
|
29 | - 'c','A','A','A','A','E','E','I','O','O','O','U','U','C'); |
|
26 | + $aFind = array('&', 'á', 'à', 'ã', 'â', 'é', 'ê', 'í', 'ó', 'ô', 'õ', 'ú', 'ü', |
|
27 | + 'ç', 'Á', 'À', 'Ã', 'Â', 'É', 'Ê', 'Í', 'Ó', 'Ô', 'Õ', 'Ú', 'Ü', 'Ç'); |
|
28 | + $aSubs = array('e', 'a', 'a', 'a', 'a', 'e', 'e', 'i', 'o', 'o', 'o', 'u', 'u', |
|
29 | + 'c', 'A', 'A', 'A', 'A', 'E', 'E', 'I', 'O', 'O', 'O', 'U', 'U', 'C'); |
|
30 | 30 | $novoTexto = str_replace($aFind, $aSubs, $texto); |
31 | 31 | $novoTexto = preg_replace("/[^a-zA-Z0-9 @,-.;:\/]/", "", $novoTexto); |
32 | 32 | return $novoTexto; |
@@ -71,11 +71,11 @@ discard block |
||
71 | 71 | public static function clearProt($procXML = '') |
72 | 72 | { |
73 | 73 | $procXML = self::clearMsg($procXML); |
74 | - $aApp = array('nfe','cte','mdfe'); |
|
74 | + $aApp = array('nfe', 'cte', 'mdfe'); |
|
75 | 75 | foreach ($aApp as $app) { |
76 | 76 | $procXML = str_replace( |
77 | - 'xmlns="http://www.portalfiscal.inf.br/'.$app.'" xmlns="http://www.w3.org/2000/09/xmldsig#"', |
|
78 | - 'xmlns="http://www.portalfiscal.inf.br/'.$app.'"', |
|
77 | + 'xmlns="http://www.portalfiscal.inf.br/' . $app . '" xmlns="http://www.w3.org/2000/09/xmldsig#"', |
|
78 | + 'xmlns="http://www.portalfiscal.inf.br/' . $app . '"', |
|
79 | 79 | $procXML |
80 | 80 | ); |
81 | 81 | } |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | */ |
90 | 90 | public static function clearMsg($msg) |
91 | 91 | { |
92 | - $nmsg = str_replace(array(' standalone="no"','default:',':default',"\n","\r","\t"), '', $msg); |
|
92 | + $nmsg = str_replace(array(' standalone="no"', 'default:', ':default', "\n", "\r", "\t"), '', $msg); |
|
93 | 93 | $nnmsg = str_replace('> ', '>', $nmsg); |
94 | 94 | if (strpos($nnmsg, '> ')) { |
95 | 95 | $nnmsg = self::clearMsg((string) $nnmsg); |
@@ -251,11 +251,11 @@ |
||
251 | 251 | if (is_file($pathContingencia)) { |
252 | 252 | $contJson = Files\FilesFolders::readFile($pathContingencia); |
253 | 253 | if (! empty($contJson)) { |
254 | - $aCont = (array) json_decode($contJson); |
|
255 | - $this->motivoContingencia = $aCont['motivo']; |
|
256 | - $this->tsContingencia = $aCont['ts']; |
|
257 | - $this->enableSVCAN = $aCont['SVCAN']; |
|
258 | - $this->enableSVCRS = $aCont['SVCRS']; |
|
254 | + $aCont = (array) json_decode($contJson); |
|
255 | + $this->motivoContingencia = $aCont['motivo']; |
|
256 | + $this->tsContingencia = $aCont['ts']; |
|
257 | + $this->enableSVCAN = $aCont['SVCAN']; |
|
258 | + $this->enableSVCRS = $aCont['SVCRS']; |
|
259 | 259 | } |
260 | 260 | } |
261 | 261 | } |
@@ -213,7 +213,7 @@ discard block |
||
213 | 213 | $configJson = Files\FilesFolders::readFile($configJson); |
214 | 214 | } |
215 | 215 | //carrega os dados de configuração |
216 | - $this->aConfig = (array) json_decode($configJson); |
|
216 | + $this->aConfig = (array) json_decode($configJson); |
|
217 | 217 | if (key_exists('aDocFormat', $this->aConfig)) { |
218 | 218 | $this->aDocFormat = (array) $this->aConfig['aDocFormat']; |
219 | 219 | } |
@@ -234,7 +234,7 @@ discard block |
||
234 | 234 | if ($this->oCertificate->priKey == '') { |
235 | 235 | //tentar carregar novo certificado |
236 | 236 | $this->atualizaCertificado( |
237 | - $this->aConfig['pathCertsFiles'].$this->aConfig['certPfxName'], |
|
237 | + $this->aConfig['pathCertsFiles'] . $this->aConfig['certPfxName'], |
|
238 | 238 | $this->aConfig['certPassword'] |
239 | 239 | ); |
240 | 240 | if ($this->oCertificate->expireTimestamp == 0) { |
@@ -246,11 +246,11 @@ discard block |
||
246 | 246 | $this->certExpireTimestamp = $this->oCertificate->expireTimestamp; |
247 | 247 | $this->zLoadSoapClass(); |
248 | 248 | //verifica se a contingência está ativada |
249 | - $pathContingencia = NFEPHP_ROOT.DIRECTORY_SEPARATOR.'config'. |
|
250 | - DIRECTORY_SEPARATOR.$this->aConfig['cnpj'].'_contingencia.json'; |
|
249 | + $pathContingencia = NFEPHP_ROOT . DIRECTORY_SEPARATOR . 'config' . |
|
250 | + DIRECTORY_SEPARATOR . $this->aConfig['cnpj'] . '_contingencia.json'; |
|
251 | 251 | if (is_file($pathContingencia)) { |
252 | 252 | $contJson = Files\FilesFolders::readFile($pathContingencia); |
253 | - if (! empty($contJson)) { |
|
253 | + if (!empty($contJson)) { |
|
254 | 254 | $aCont = (array) json_decode($contJson); |
255 | 255 | $this->motivoContingencia = $aCont['motivo']; |
256 | 256 | $this->tsContingencia = $aCont['ts']; |
@@ -270,7 +270,7 @@ discard block |
||
270 | 270 | */ |
271 | 271 | public function setSSLProtocol($protocol = '') |
272 | 272 | { |
273 | - if (! empty($protocol)) { |
|
273 | + if (!empty($protocol)) { |
|
274 | 274 | switch ($protocol) { |
275 | 275 | case 'TLSv1': |
276 | 276 | $this->sslProtocol = 1; |
@@ -304,7 +304,7 @@ discard block |
||
304 | 304 | */ |
305 | 305 | public function getSSLProtocol() |
306 | 306 | { |
307 | - $aPr = array('default','TLSv1','SSLv2','SSLv3','TLSv1.0','TLSv1.1','TLSv1.2'); |
|
307 | + $aPr = array('default', 'TLSv1', 'SSLv2', 'SSLv3', 'TLSv1.0', 'TLSv1.1', 'TLSv1.2'); |
|
308 | 308 | return $aPr[$this->sslProtocol]; |
309 | 309 | } |
310 | 310 | |
@@ -314,7 +314,7 @@ discard block |
||
314 | 314 | */ |
315 | 315 | public function setSoapTimeOut($segundos = 10) |
316 | 316 | { |
317 | - if (! empty($segundos)) { |
|
317 | + if (!empty($segundos)) { |
|
318 | 318 | $this->soapTimeout = $segundos; |
319 | 319 | $this->zLoadSoapClass(); |
320 | 320 | } |
@@ -560,7 +560,7 @@ discard block |
||
560 | 560 | protected function zLoadSEFAZ($pathXmlUrlFile = '', $tpAmb = '2', $siglaUF = 'SP', $tipo = 'nfe') |
561 | 561 | { |
562 | 562 | //verifica se o arquivo xml pode ser encontrado no caminho indicado |
563 | - if (! file_exists($pathXmlUrlFile)) { |
|
563 | + if (!file_exists($pathXmlUrlFile)) { |
|
564 | 564 | throw new Exception\RuntimeException( |
565 | 565 | "Arquivo $pathXmlUrlFile não encontrado." |
566 | 566 | ); |
@@ -717,9 +717,9 @@ discard block |
||
717 | 717 | $path = $this->aConfig['pathMDFeFiles']; |
718 | 718 | } |
719 | 719 | $pathTemp = Files\FilesFolders::getFilePath($tpAmb, $path, $subFolder) |
720 | - . DIRECTORY_SEPARATOR.$anomes; |
|
721 | - if (! Files\FilesFolders::saveFile($pathTemp, $filename, $data)) { |
|
722 | - $msg = 'Falha na gravação no diretório. '.$pathTemp; |
|
720 | + . DIRECTORY_SEPARATOR . $anomes; |
|
721 | + if (!Files\FilesFolders::saveFile($pathTemp, $filename, $data)) { |
|
722 | + $msg = 'Falha na gravação no diretório. ' . $pathTemp; |
|
723 | 723 | throw new Exception\RuntimeException($msg); |
724 | 724 | } |
725 | 725 | } |