Completed
Pull Request — master (#62)
by Roberto
07:08
created
src/Common/Soap/SoapCode.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@
 block discarded – undo
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
         }
Please login to merge, or discard this patch.
src/Common/Soap/SoapCurl.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
                 curl_setopt($oCurl, CURLOPT_KEYPASSWD, $this->temppass);
79 79
             }
80 80
             curl_setopt($oCurl, CURLOPT_RETURNTRANSFER, true);
81
-            if (! empty($envelope)) {
81
+            if (!empty($envelope)) {
82 82
                 curl_setopt($oCurl, CURLOPT_POST, true);
83 83
                 curl_setopt($oCurl, CURLOPT_POSTFIELDS, $envelope);
84 84
                 curl_setopt($oCurl, CURLOPT_HTTPHEADER, $parameters);
@@ -159,9 +159,9 @@  discard block
 block discarded – undo
159 159
         if ($this->proxyIP != '') {
160 160
             curl_setopt($oCurl, CURLOPT_HTTPPROXYTUNNEL, 1);
161 161
             curl_setopt($oCurl, CURLOPT_PROXYTYPE, CURLPROXY_HTTP);
162
-            curl_setopt($oCurl, CURLOPT_PROXY, $this->proxyIP.':'.$this->proxyPort);
162
+            curl_setopt($oCurl, CURLOPT_PROXY, $this->proxyIP . ':' . $this->proxyPort);
163 163
             if ($this->proxyUser != '') {
164
-                curl_setopt($oCurl, CURLOPT_PROXYUSERPWD, $this->proxyUser.':'.$this->proxyPass);
164
+                curl_setopt($oCurl, CURLOPT_PROXYUSERPWD, $this->proxyUser . ':' . $this->proxyPass);
165 165
                 curl_setopt($oCurl, CURLOPT_PROXYAUTH, CURLAUTH_BASIC);
166 166
             }
167 167
         }
Please login to merge, or discard this patch.
src/Common/FakePretty.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@
 block discarded – undo
50 50
         $html .= '<h2>body</h2>';
51 51
         $html .= str_replace(
52 52
             ['<', '>'],
53
-            ['&lt;','&gt;'],
53
+            ['&lt;', '&gt;'],
54 54
             str_replace(
55 55
                 '<?xml version="1.0"?>',
56 56
                 '<?xml version="1.0" encoding="UTF-8"?>',
Please login to merge, or discard this patch.
src/Common/Factory.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -216,7 +216,7 @@
 block discarded – undo
216 216
             return true;
217 217
         }
218 218
         $validator = new JsonValid();
219
-        $validator->check($data, (object)['$ref' => 'file://' . $this->jsonschema]);
219
+        $validator->check($data, (object) ['$ref' => 'file://' . $this->jsonschema]);
220 220
         if (!$validator->isValid()) {
221 221
             $msg = "";
222 222
             foreach ($validator->getErrors() as $error) {
Please login to merge, or discard this patch.
src/Common/Soap/SoapBase.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -384,9 +384,9 @@  discard block
 block discarded – undo
384 384
             );
385 385
         }
386 386
         $this->certsdir = $this->certificate->getCnpj() . '/certs/';
387
-        $this->prifile = $this->certsdir. Strings::randomString(10).'.pem';
388
-        $this->pubfile = $this->certsdir . Strings::randomString(10).'.pem';
389
-        $this->certfile = $this->certsdir . Strings::randomString(10).'.pem';
387
+        $this->prifile = $this->certsdir . Strings::randomString(10) . '.pem';
388
+        $this->pubfile = $this->certsdir . Strings::randomString(10) . '.pem';
389
+        $this->certfile = $this->certsdir . Strings::randomString(10) . '.pem';
390 390
         $ret = true;
391 391
         $private = $this->certificate->privateKey;
392 392
         if ($this->encriptPrivateKey) {
@@ -411,7 +411,7 @@  discard block
 block discarded – undo
411 411
         );
412 412
         $ret &= $this->filesystem->put(
413 413
             $this->certfile,
414
-            $private."{$this->certificate}"
414
+            $private . "{$this->certificate}"
415 415
         );
416 416
         if (!$ret) {
417 417
             throw new RuntimeException(
@@ -437,7 +437,7 @@  discard block
 block discarded – undo
437 437
         //utilize a API. Outra solução para remover arquivos "perdidos" pode ser
438 438
         //encontrada oportunamente.
439 439
         $dt = new \DateTime();
440
-        $tint = new \DateInterval("PT".$this->waitingTime."M");
440
+        $tint = new \DateInterval("PT" . $this->waitingTime . "M");
441 441
         $tint->invert = 1;
442 442
         $tsLimit = $dt->add($tint)->getTimestamp();
443 443
         foreach ($contents as $item) {
Please login to merge, or discard this patch.
src/Factories/EvtTabProcesso.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -73,7 +73,7 @@
 block discarded – undo
73 73
         $this->node->insertBefore($ideEvento, $ideContri);
74 74
         //tag deste evento em particular
75 75
         $info = $this->dom->createElement("infoProcesso");
76
-        $ideProcesso  = $this->dom->createElement("ideProcesso");
76
+        $ideProcesso = $this->dom->createElement("ideProcesso");
77 77
         $this->dom->addChild(
78 78
             $ideProcesso,
79 79
             "tpProc",
Please login to merge, or discard this patch.
src/Common/ProcessNumber.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
         $x = substr($input, 5, 6);
56 56
         $y = substr($input, 11, 4);
57 57
         $dd = substr($input, -2);
58
-        $value = $n.$x.$y;
58
+        $value = $n . $x . $y;
59 59
         $a = str_split($value);
60 60
         $soma = 0;
61 61
         $i = 16;
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
         if ($m2 > 9) {
79 79
             $m2 -= 10;
80 80
         }
81
-        return $m1.$m2;
81
+        return $m1 . $m2;
82 82
     }
83 83
     
84 84
     /**
@@ -106,8 +106,8 @@  discard block
 block discarded – undo
106 106
      */
107 107
     protected static function clearString($input, $lenght)
108 108
     {
109
-        $input = str_replace(['-','/','.'], '', $input);
110
-        $input = substr($input, 0, $lenght-1);
109
+        $input = str_replace(['-', '/', '.'], '', $input);
110
+        $input = substr($input, 0, $lenght - 1);
111 111
         $input = str_pad($input, $lenght, '0', STR_PAD_RIGHT);
112 112
         if (!preg_match('/^[0-9]+$/', $input)) {
113 113
             throw new \InvalidArgumentException("O numero do processo tem estrutura incorreta.");
Please login to merge, or discard this patch.
src/Common/Tools.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -97,17 +97,17 @@  discard block
 block discarded – undo
97 97
      * @var array
98 98
      */
99 99
     protected $grupos = [
100
-        1 => [ //EVENTOS INICIAIS grupo [1]
100
+        1 => [//EVENTOS INICIAIS grupo [1]
101 101
             'R-1000',
102 102
             'R-1070'
103 103
         ],
104
-        2 => [ //EVENTOS NÃO PERIÓDICOS grupo [2]
104
+        2 => [//EVENTOS NÃO PERIÓDICOS grupo [2]
105 105
             'R-3010',
106 106
             'R-5001',
107 107
             'R-5011',
108 108
             'R-9000'
109 109
         ],
110
-        3 => [ //EVENTOS PERIÓDICOS grupo [3]
110
+        3 => [//EVENTOS PERIÓDICOS grupo [3]
111 111
             'R-2010',
112 112
             'R-2020',
113 113
             'R-2030',
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
         
146 146
         $this->path = realpath(
147 147
             __DIR__ . '/../../'
148
-        ).'/';
148
+        ) . '/';
149 149
         
150 150
         $this->serviceXsd = XsdSeeker::seek(
151 151
             $this->path . "schemes/comunicacao/v$this->serviceVersion/"
Please login to merge, or discard this patch.
src/Tools.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -198,7 +198,7 @@  discard block
 block discarded – undo
198 198
         $this->validInputParameters($properties, $std);
199 199
         
200 200
         $this->method = "ConsultaInformacoesConsolidadas";
201
-        $this->action = "http://sped.fazenda.gov.br/ConsultasReinf/".$this->method;
201
+        $this->action = "http://sped.fazenda.gov.br/ConsultasReinf/" . $this->method;
202 202
         $request = "<sped:{$this->method}>"
203 203
             . "<sped:tipoInscricaoContribuinte>{$std->tipoinscricaocontribuinte}</sped:tipoInscricaoContribuinte>"
204 204
             . "<sped:numeroInscricaoContribuinte>{$std->numeroinscricaocontribuinte}</sped:numeroInscricaoContribuinte>"
@@ -215,7 +215,7 @@  discard block
 block discarded – undo
215 215
     protected function consultR1($evt)
216 216
     {
217 217
         $this->method = "ConsultaReciboEvento{$evt}";
218
-        $this->action = "http://sped.fazenda.gov.br/ConsultasReinf/".$this->method;
218
+        $this->action = "http://sped.fazenda.gov.br/ConsultasReinf/" . $this->method;
219 219
         $request = "<sped:{$this->method}>"
220 220
             . "<sped:tipoEvento>{$evt}</sped:tipoEvento>"
221 221
             . "<sped:tpInsc>{$this->tpInsc}</sped:tpInsc>"
@@ -258,7 +258,7 @@  discard block
 block discarded – undo
258 258
         $this->validInputParameters($properties, $std);
259 259
         
260 260
         $this->method = "ConsultaReciboEvento{$evt}";
261
-        $this->action = "http://sped.fazenda.gov.br/ConsultasReinf/".$this->method;
261
+        $this->action = "http://sped.fazenda.gov.br/ConsultasReinf/" . $this->method;
262 262
         $request = "<sped:{$this->method}>"
263 263
             . "<sped:tipoEvento>{$evt}</sped:tipoEvento>"
264 264
             . "<sped:tpInsc>{$this->tpInsc}</sped:tpInsc>"
@@ -305,7 +305,7 @@  discard block
 block discarded – undo
305 305
         $this->validInputParameters($properties, $std);
306 306
         
307 307
         $this->method = "ConsultaReciboEvento{$evt}";
308
-        $this->action = "http://sped.fazenda.gov.br/ConsultasReinf/".$this->method;
308
+        $this->action = "http://sped.fazenda.gov.br/ConsultasReinf/" . $this->method;
309 309
         $request = "<sped:{$this->method}>"
310 310
             . "<sped:tipoEvento>{$evt}</sped:tipoEvento>"
311 311
             . "<sped:tpInsc>{$this->tpInsc}</sped:tpInsc>"
@@ -341,7 +341,7 @@  discard block
 block discarded – undo
341 341
         $this->validInputParameters($properties, $std);
342 342
         
343 343
         $this->method = "ConsultaReciboEvento{$evt}";
344
-        $this->action = "http://sped.fazenda.gov.br/ConsultasReinf/".$this->method;
344
+        $this->action = "http://sped.fazenda.gov.br/ConsultasReinf/" . $this->method;
345 345
         $request = "<sped:{$this->method}>"
346 346
             . "<sped:tipoEvento>{$evt}</sped:tipoEvento>"
347 347
             . "<sped:tpInsc>{$this->tpInsc}</sped:tpInsc>"
@@ -386,7 +386,7 @@  discard block
 block discarded – undo
386 386
         $this->validInputParameters($properties, $std);
387 387
         
388 388
         $this->method = "ConsultaReciboEvento{$evt}";
389
-        $this->action = "http://sped.fazenda.gov.br/ConsultasReinf/".$this->method;
389
+        $this->action = "http://sped.fazenda.gov.br/ConsultasReinf/" . $this->method;
390 390
         $request = "<sped:{$this->method}>"
391 391
             . "<sped:tipoEvento>{$evt}</sped:tipoEvento>"
392 392
             . "<sped:tpInsc>{$this->tpInsc}</sped:tpInsc>"
@@ -416,7 +416,7 @@  discard block
 block discarded – undo
416 416
         $this->validInputParameters($properties, $std);
417 417
         
418 418
         $this->method = "ConsultaReciboEvento{$evt}";
419
-        $this->action = "http://sped.fazenda.gov.br/ConsultasReinf/".$this->method;
419
+        $this->action = "http://sped.fazenda.gov.br/ConsultasReinf/" . $this->method;
420 420
         $request = "<sped:{$this->method}>"
421 421
             . "<sped:tipoEvento>{$evt}</sped:tipoEvento>"
422 422
             . "<sped:tpInsc>{$this->tpInsc}</sped:tpInsc>"
@@ -449,7 +449,7 @@  discard block
 block discarded – undo
449 449
         $this->validInputParameters($properties, $std);
450 450
         
451 451
         $this->method = "ConsultaReciboEvento{$evt}";
452
-        $this->action = "http://sped.fazenda.gov.br/ConsultasReinf/".$this->method;
452
+        $this->action = "http://sped.fazenda.gov.br/ConsultasReinf/" . $this->method;
453 453
         $request = "<sped:{$this->method}>"
454 454
             . "<sped:tipoEvento>{$evt}</sped:tipoEvento>"
455 455
             . "<sped:tpInsc>{$this->tpInsc}</sped:tpInsc>"
@@ -485,20 +485,20 @@  discard block
 block discarded – undo
485 485
                 throw ProcessException::wrongArgument(2002, '');
486 486
             }
487 487
             //verifica se o evento pertence ao grupo indicado
488
-            if (! in_array($evt->alias(), $this->grupos[$grupo])) {
488
+            if (!in_array($evt->alias(), $this->grupos[$grupo])) {
489 489
                 throw new \RuntimeException(
490 490
                     'O evento ' . $evt->alias() . ' não pertence a este grupo [ '
491 491
                     . $this->eventGroup[$grupo] . ' ].'
492 492
                 );
493 493
             }
494 494
             $this->checkCertificate($evt);
495
-            $xml .= "<evento id=\"".$evt->getId()."\">";
495
+            $xml .= "<evento id=\"" . $evt->getId() . "\">";
496 496
             $xml .= $evt->toXML();
497 497
             $xml .= "</evento>";
498 498
         }
499 499
         //build request
500 500
         $request = "<Reinf xmlns=\"http://www.reinf.esocial.gov.br/schemas/envioLoteEventos/v"
501
-            . $this->serviceVersion."\" >"
501
+            . $this->serviceVersion . "\" >"
502 502
             . "<loteEventos>"
503 503
             . $xml
504 504
             . "</loteEventos>"
Please login to merge, or discard this patch.