Completed
Pull Request — master (#137)
by Roberto
03:23
created
src/Common/Soap/SoapBase.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -186,7 +186,7 @@  discard block
 block discarded – undo
186 186
     ) {
187 187
         $this->logger      = $logger;
188 188
         $this->certificate = $this->checkCertValidity($certificate);
189
-        $this->setTemporaryFolder(sys_get_temp_dir().'/sped/');
189
+        $this->setTemporaryFolder(sys_get_temp_dir() . '/sped/');
190 190
     }
191 191
 
192 192
     /**
@@ -202,7 +202,7 @@  discard block
 block discarded – undo
202 202
         if ($this->disableCertValidation) {
203 203
             return $certificate;
204 204
         }
205
-        if (! empty($certificate)) {
205
+        if (!empty($certificate)) {
206 206
             if ($certificate->isExpired()) {
207 207
                 throw new RuntimeException(
208 208
                     'The validity of the certificate has expired.'
@@ -261,7 +261,7 @@  discard block
 block discarded – undo
261 261
         //utilize a API. Outra solução para remover arquivos "perdidos" pode ser
262 262
         //encontrada oportunamente.
263 263
         $dt           = new \DateTime();
264
-        $tint         = new \DateInterval("PT".$this->waitingTime."M");
264
+        $tint         = new \DateInterval("PT" . $this->waitingTime . "M");
265 265
         $tint->invert = true;
266 266
         $tsLimit      = $dt->add($tint)->getTimestamp();
267 267
         foreach ($contents as $item) {
@@ -431,15 +431,15 @@  discard block
 block discarded – undo
431 431
      */
432 432
     public function saveTemporarilyKeyFiles()
433 433
     {
434
-        if (! is_object($this->certificate)) {
434
+        if (!is_object($this->certificate)) {
435 435
             throw new RuntimeException(
436 436
                 'Certificate not found.'
437 437
             );
438 438
         }
439
-        $this->certsdir = $this->certificate->getCnpj().'/certs/';
440
-        $this->prifile  = $this->certsdir.Strings::randomString(10).'.pem';
441
-        $this->pubfile  = $this->certsdir.Strings::randomString(10).'.pem';
442
-        $this->certfile = $this->certsdir.Strings::randomString(10).'.pem';
439
+        $this->certsdir = $this->certificate->getCnpj() . '/certs/';
440
+        $this->prifile  = $this->certsdir . Strings::randomString(10) . '.pem';
441
+        $this->pubfile  = $this->certsdir . Strings::randomString(10) . '.pem';
442
+        $this->certfile = $this->certsdir . Strings::randomString(10) . '.pem';
443 443
         $ret            = true;
444 444
         $private        = $this->certificate->privateKey;
445 445
         if ($this->encriptPrivateKey) {
@@ -464,9 +464,9 @@  discard block
 block discarded – undo
464 464
         );
465 465
         $ret &= $this->filesystem->put(
466 466
             $this->certfile,
467
-            $private."{$this->certificate}"
467
+            $private . "{$this->certificate}"
468 468
         );
469
-        if (! $ret) {
469
+        if (!$ret) {
470 470
             throw new RuntimeException(
471 471
                 'Unable to save temporary key files in folder.'
472 472
             );
@@ -484,19 +484,19 @@  discard block
 block discarded – undo
484 484
      */
485 485
     public function saveDebugFiles($operation, $request, $response)
486 486
     {
487
-        if (! $this->debugmode) {
487
+        if (!$this->debugmode) {
488 488
             return;
489 489
         }
490
-        $this->debugdir = $this->certificate->getCnpj().'/debug/';
490
+        $this->debugdir = $this->certificate->getCnpj() . '/debug/';
491 491
         $now = \DateTime::createFromFormat('U.u', number_format(microtime(true), 6, '.', ''));
492 492
         $time = substr($now->format("ymdHisu"), 0, 16);
493 493
         try {
494 494
             $this->filesystem->put(
495
-                $this->debugdir.$time."_".$operation."_sol.txt",
495
+                $this->debugdir . $time . "_" . $operation . "_sol.txt",
496 496
                 $request
497 497
             );
498 498
             $this->filesystem->put(
499
-                $this->debugdir.$time."_".$operation."_res.txt",
499
+                $this->debugdir . $time . "_" . $operation . "_res.txt",
500 500
                 $response
501 501
             );
502 502
         } catch (Exception $e) {
@@ -526,10 +526,10 @@  discard block
 block discarded – undo
526 526
         foreach ($namespaces as $key => $value) {
527 527
             $envelope .= " $key=\"$value\"";
528 528
         }
529
-        $envelope   .= ">";
529
+        $envelope .= ">";
530 530
         $soapheader = "<$prefix:Header/>";
531
-        if (! empty($header)) {
532
-            $ns         = ! empty($header->namespace) ? $header->namespace : '';
531
+        if (!empty($header)) {
532
+            $ns         = !empty($header->namespace) ? $header->namespace : '';
533 533
             $name       = $header->name;
534 534
             $soapheader = "<$prefix:Header>";
535 535
             $soapheader .= "<$name xmlns=\"$ns\">";
Please login to merge, or discard this patch.