@@ -51,7 +51,7 @@ |
||
51 | 51 | */ |
52 | 52 | private static function loadOids() |
53 | 53 | { |
54 | - $json = file_get_contents(__DIR__ .'/oids.json'); |
|
54 | + $json = file_get_contents(__DIR__ . '/oids.json'); |
|
55 | 55 | self::$oidsTable = (array) json_decode($json, true); |
56 | 56 | } |
57 | 57 | } |
@@ -30,7 +30,7 @@ |
||
30 | 30 | */ |
31 | 31 | public function __doRequest($request, $location, $action, $version, $oneWay = 0) |
32 | 32 | { |
33 | - $search = [":ns1","ns1:","\n","\r"]; |
|
33 | + $search = [":ns1", "ns1:", "\n", "\r"]; |
|
34 | 34 | return parent::__doRequest( |
35 | 35 | str_replace($search, '', $request), |
36 | 36 | $location, |
@@ -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 | } |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | //get length of OID data |
78 | 78 | $len = self::getLength((string) $data); |
79 | 79 | //get only a string with bytes belongs to OID |
80 | - $oidData = substr($data, 2 + $bytes, $len-($bytes)); |
|
80 | + $oidData = substr($data, 2 + $bytes, $len - ($bytes)); |
|
81 | 81 | //parse OID data many possibel formats and structures |
82 | 82 | $head = strlen($oidData) - strlen($xcv) - 2; |
83 | 83 | $ret = substr($oidData, -$head); |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | if ($num == 0) { |
122 | 122 | $bun = 40 * $partes[$num]; |
123 | 123 | } elseif ($num == 1) { |
124 | - $bun += $partes[$num]; |
|
124 | + $bun += $partes[$num]; |
|
125 | 125 | $abBinary[] = $bun; |
126 | 126 | } else { |
127 | 127 | $abBinary = self::xBase128((array) $abBinary, (integer) $partes[$num], true); |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | { |
146 | 146 | $abc = $abIn; |
147 | 147 | if ($qIn > 127) { |
148 | - $abc = self::xBase128($abc, floor($qIn/128), false); |
|
148 | + $abc = self::xBase128($abc, floor($qIn / 128), false); |
|
149 | 149 | } |
150 | 150 | $qIn2 = $qIn % 128; |
151 | 151 | if ($flag) { |
@@ -87,7 +87,7 @@ |
||
87 | 87 | */ |
88 | 88 | public function __toString() |
89 | 89 | { |
90 | - $messages = array_map(function (\Exception $exception) { |
|
90 | + $messages = array_map(function(\Exception $exception) { |
|
91 | 91 | return $exception->getMessage(); |
92 | 92 | }, $this->exceptions); |
93 | 93 | return implode(PHP_EOL, $messages); |
@@ -387,9 +387,9 @@ discard block |
||
387 | 387 | ); |
388 | 388 | } |
389 | 389 | $this->certsdir = $this->certificate->getCnpj() . '/certs/'; |
390 | - $this->prifile = $this->certsdir. Strings::randomString(10).'.pem'; |
|
391 | - $this->pubfile = $this->certsdir . Strings::randomString(10).'.pem'; |
|
392 | - $this->certfile = $this->certsdir . Strings::randomString(10).'.pem'; |
|
390 | + $this->prifile = $this->certsdir . Strings::randomString(10) . '.pem'; |
|
391 | + $this->pubfile = $this->certsdir . Strings::randomString(10) . '.pem'; |
|
392 | + $this->certfile = $this->certsdir . Strings::randomString(10) . '.pem'; |
|
393 | 393 | $ret = true; |
394 | 394 | $private = $this->certificate->privateKey; |
395 | 395 | if ($this->encriptPrivateKey) { |
@@ -414,7 +414,7 @@ discard block |
||
414 | 414 | ); |
415 | 415 | $ret &= $this->filesystem->put( |
416 | 416 | $this->certfile, |
417 | - $private."{$this->certificate}" |
|
417 | + $private . "{$this->certificate}" |
|
418 | 418 | ); |
419 | 419 | if (!$ret) { |
420 | 420 | throw new RuntimeException( |
@@ -440,7 +440,7 @@ discard block |
||
440 | 440 | //utilize a API. Outra solução para remover arquivos "perdidos" pode ser |
441 | 441 | //encontrada oportunamente. |
442 | 442 | $dt = new \DateTime(); |
443 | - $tint = new \DateInterval("PT".$this->waitingTime."M"); |
|
443 | + $tint = new \DateInterval("PT" . $this->waitingTime . "M"); |
|
444 | 444 | $tint->invert = true; |
445 | 445 | $tsLimit = $dt->add($tint)->getTimestamp(); |
446 | 446 | foreach ($contents as $item) { |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | curl_setopt($oCurl, CURLOPT_KEYPASSWD, $this->temppass); |
99 | 99 | } |
100 | 100 | curl_setopt($oCurl, CURLOPT_RETURNTRANSFER, 1); |
101 | - if (! empty($envelope)) { |
|
101 | + if (!empty($envelope)) { |
|
102 | 102 | curl_setopt($oCurl, CURLOPT_POST, 1); |
103 | 103 | curl_setopt($oCurl, CURLOPT_POSTFIELDS, $envelope); |
104 | 104 | curl_setopt($oCurl, CURLOPT_HTTPHEADER, $parameters); |
@@ -140,9 +140,9 @@ discard block |
||
140 | 140 | if ($this->proxyIP != '') { |
141 | 141 | curl_setopt($oCurl, CURLOPT_HTTPPROXYTUNNEL, 1); |
142 | 142 | curl_setopt($oCurl, CURLOPT_PROXYTYPE, CURLPROXY_HTTP); |
143 | - curl_setopt($oCurl, CURLOPT_PROXY, $this->proxyIP.':'.$this->proxyPort); |
|
143 | + curl_setopt($oCurl, CURLOPT_PROXY, $this->proxyIP . ':' . $this->proxyPort); |
|
144 | 144 | if ($this->proxyUser != '') { |
145 | - curl_setopt($oCurl, CURLOPT_PROXYUSERPWD, $this->proxyUser.':'.$this->proxyPass); |
|
145 | + curl_setopt($oCurl, CURLOPT_PROXYUSERPWD, $this->proxyUser . ':' . $this->proxyPass); |
|
146 | 146 | curl_setopt($oCurl, CURLOPT_PROXYAUTH, CURLAUTH_BASIC); |
147 | 147 | } |
148 | 148 | } |
@@ -17,9 +17,9 @@ |
||
17 | 17 | { |
18 | 18 | $msg = ''; |
19 | 19 | foreach ($errors as $error) { |
20 | - $msg .= $error."\n"; |
|
20 | + $msg .= $error . "\n"; |
|
21 | 21 | } |
22 | - return new static('This XML is not valid. '.$msg); |
|
22 | + return new static('This XML is not valid. ' . $msg); |
|
23 | 23 | } |
24 | 24 | |
25 | 25 | public static function isNotXml() |
@@ -39,7 +39,7 @@ |
||
39 | 39 | $dom->formatOutput = false; |
40 | 40 | $dom->loadXML($xml, LIBXML_NOBLANKS | LIBXML_NOEMPTYTAG); |
41 | 41 | libxml_clear_errors(); |
42 | - if (! $dom->schemaValidate($xsd)) { |
|
42 | + if (!$dom->schemaValidate($xsd)) { |
|
43 | 43 | $errors = []; |
44 | 44 | foreach (libxml_get_errors() as $error) { |
45 | 45 | $errors[] = $error->message; |