Passed
Push — master ( cbb0fa...beaba6 )
by Roberto
04:17 queued 01:29
created
src/CTe/Dacte.php 2 patches
Doc Comments   +45 added lines, -46 removed lines patch added patch discarded remove patch
@@ -98,6 +98,9 @@  discard block
 block discarded – undo
98 98
         $this->loadDoc($xml);
99 99
     }
100 100
 
101
+    /**
102
+     * @param string $xml
103
+     */
101 104
     private function loadDoc($xml)
102 105
     {
103 106
         $this->xml = $xml;
@@ -211,10 +214,6 @@  discard block
 block discarded – undo
211 214
      * A definição de margens e posições iniciais para a impressão são estabelecidas no
212 215
      * pelo conteúdo da funçao e podem ser modificados.
213 216
      *
214
-     * @param string $orientacao (Opcional) Estabelece a orientação da
215
-     *                impressão (ex. P-retrato), se nada for fornecido será
216
-     *                usado o padrão da NFe
217
-     * @param string $papel (Opcional) Estabelece o tamanho do papel (ex. A4)
218 217
      * @return string O ID da NFe numero de 44 digitos extraido do arquivo XML
219 218
      */
220 219
     protected function monta(
@@ -441,8 +440,8 @@  discard block
 block discarded – undo
441 440
      * cabecalho
442 441
      * Monta o cabelhalho da DACTE ( retrato e paisagem )
443 442
      *
444
-     * @param number $x Posição horizontal inicial, canto esquerdo
445
-     * @param number $y Posição vertical inicial, canto superior
443
+     * @param integer $x Posição horizontal inicial, canto esquerdo
444
+     * @param integer $y Posição vertical inicial, canto superior
446 445
      * @param number $pag Número da Página
447 446
      * @param number $totPag Total de páginas
448 447
      * @return number Posição vertical final
@@ -1096,8 +1095,7 @@  discard block
 block discarded – undo
1096 1095
      * rodapeDACTE
1097 1096
      * Monta o rodape no final da DACTE ( retrato e paisagem )
1098 1097
      *
1099
-     * @param number $xInic Posição horizontal canto esquerdo
1100
-     * @param number $yFinal Posição vertical final para impressão
1098
+     * @param integer $x
1101 1099
      */
1102 1100
     protected function rodape($x, $y)
1103 1101
     {
@@ -1121,8 +1119,8 @@  discard block
 block discarded – undo
1121 1119
      * remetente
1122 1120
      * Monta o campo com os dados do remetente na DACTE. ( retrato  e paisagem  )
1123 1121
      *
1124
-     * @param number $x Posição horizontal canto esquerdo
1125
-     * @param number $y Posição vertical canto superior
1122
+     * @param integer $x Posição horizontal canto esquerdo
1123
+     * @param integer $y Posição vertical canto superior
1126 1124
      * @return number Posição vertical final
1127 1125
      */
1128 1126
     protected function remetente($x = 0, $y = 0)
@@ -1209,8 +1207,8 @@  discard block
 block discarded – undo
1209 1207
      * destinatario
1210 1208
      * Monta o campo com os dados do destinatário na DACTE.
1211 1209
      *
1212
-     * @param number $x Posição horizontal canto esquerdo
1213
-     * @param number $y Posição vertical canto superior
1210
+     * @param integer $x Posição horizontal canto esquerdo
1211
+     * @param integer $y Posição vertical canto superior
1214 1212
      * @return number Posição vertical final
1215 1213
      */
1216 1214
     protected function destinatario($x = 0, $y = 0)
@@ -1296,8 +1294,8 @@  discard block
 block discarded – undo
1296 1294
      * expedidor
1297 1295
      * Monta o campo com os dados do remetente na DACTE. ( retrato  e paisagem  )
1298 1296
      *
1299
-     * @param number $x Posição horizontal canto esquerdo
1300
-     * @param number $y Posição vertical canto superior
1297
+     * @param integer $x Posição horizontal canto esquerdo
1298
+     * @param integer $y Posição vertical canto superior
1301 1299
      * @return number Posição vertical final
1302 1300
      */
1303 1301
     protected function expedidor($x = 0, $y = 0)
@@ -1393,8 +1391,8 @@  discard block
 block discarded – undo
1393 1391
      * recebedor
1394 1392
      * Monta o campo com os dados do remetente na DACTE. ( retrato  e paisagem  )
1395 1393
      *
1396
-     * @param number $x Posição horizontal canto esquerdo
1397
-     * @param number $y Posição vertical canto superior
1394
+     * @param integer $x Posição horizontal canto esquerdo
1395
+     * @param integer $y Posição vertical canto superior
1398 1396
      * @return number Posição vertical final
1399 1397
      */
1400 1398
     protected function recebedor($x = 0, $y = 0)
@@ -1490,8 +1488,8 @@  discard block
 block discarded – undo
1490 1488
      * tomador
1491 1489
      * Monta o campo com os dados do remetente na DACTE. ( retrato  e paisagem  )
1492 1490
      *
1493
-     * @param number $x Posição horizontal canto esquerdo
1494
-     * @param number $y Posição vertical canto superior
1491
+     * @param integer $x Posição horizontal canto esquerdo
1492
+     * @param integer $y Posição vertical canto superior
1495 1493
      * @return number Posição vertical final
1496 1494
      */
1497 1495
     protected function tomador($x = 0, $y = 0)
@@ -1579,8 +1577,8 @@  discard block
 block discarded – undo
1579 1577
      * descricaoCarga
1580 1578
      * Monta o campo com os dados do remetente na DACTE. ( retrato  e paisagem  )
1581 1579
      *
1582
-     * @param number $x Posição horizontal canto esquerdo
1583
-     * @param number $y Posição vertical canto superior
1580
+     * @param integer $x Posição horizontal canto esquerdo
1581
+     * @param integer $y Posição vertical canto superior
1584 1582
      * @return number Posição vertical final
1585 1583
      */
1586 1584
     protected function descricaoCarga($x = 0, $y = 0)
@@ -1756,8 +1754,8 @@  discard block
 block discarded – undo
1756 1754
      * compValorServ
1757 1755
      * Monta o campo com os componentes da prestação de serviços.
1758 1756
      *
1759
-     * @param number $x Posição horizontal canto esquerdo
1760
-     * @param number $y Posição vertical canto superior
1757
+     * @param integer $x Posição horizontal canto esquerdo
1758
+     * @param integer $y Posição vertical canto superior
1761 1759
      * @return number Posição vertical final
1762 1760
      */
1763 1761
     protected function compValorServ($x = 0, $y = 0)
@@ -1855,8 +1853,8 @@  discard block
 block discarded – undo
1855 1853
      * impostos
1856 1854
      * Monta o campo com os dados do remetente na DACTE. ( retrato  e paisagem  )
1857 1855
      *
1858
-     * @param number $x Posição horizontal canto esquerdo
1859
-     * @param number $y Posição vertical canto superior
1856
+     * @param integer $x Posição horizontal canto esquerdo
1857
+     * @param integer $y Posição vertical canto superior
1860 1858
      * @return number Posição vertical final
1861 1859
      */
1862 1860
     protected function impostos($x = 0, $y = 0)
@@ -2401,8 +2399,8 @@  discard block
 block discarded – undo
2401 2399
      * docOrig
2402 2400
      * Monta o campo com os documentos originarios.
2403 2401
      *
2404
-     * @param number $x Posição horizontal canto esquerdo
2405
-     * @param number $y Posição vertical canto superior
2402
+     * @param integer $x Posição horizontal canto esquerdo
2403
+     * @param integer $y Posição vertical canto superior
2406 2404
      * @return number Posição vertical final
2407 2405
      */
2408 2406
     protected function docOrig($x = 0, $y = 0)
@@ -2697,8 +2695,8 @@  discard block
 block discarded – undo
2697 2695
      * docOrigContinuacao
2698 2696
      * Monta o campo com os documentos originarios.
2699 2697
      *
2700
-     * @param number $x Posição horizontal canto esquerdo
2701
-     * @param number $y Posição vertical canto superior
2698
+     * @param integer $x Posição horizontal canto esquerdo
2699
+     * @param integer $y Posição vertical canto superior
2702 2700
      * @return number Posição vertical final
2703 2701
      */
2704 2702
     protected function docOrigContinuacao($x = 0, $y = 0)
@@ -2818,8 +2816,8 @@  discard block
 block discarded – undo
2818 2816
      * docCompl
2819 2817
      * Monta o campo com os dados do remetente na DACTE.
2820 2818
      *
2821
-     * @param number $x Posição horizontal canto esquerdo
2822
-     * @param number $y Posição vertical canto superior
2819
+     * @param integer $x Posição horizontal canto esquerdo
2820
+     * @param integer $y Posição vertical canto superior
2823 2821
      * @return number Posição vertical final
2824 2822
      */
2825 2823
     protected function docCompl($x = 0, $y = 0)
@@ -2887,8 +2885,8 @@  discard block
 block discarded – undo
2887 2885
      * observacao
2888 2886
      * Monta o campo com os dados do remetente na DACTE.
2889 2887
      *
2890
-     * @param number $x Posição horizontal canto esquerdo
2891
-     * @param number $y Posição vertical canto superior
2888
+     * @param integer $x Posição horizontal canto esquerdo
2889
+     * @param integer $y Posição vertical canto superior
2892 2890
      * @return number Posição vertical final
2893 2891
      */
2894 2892
     protected function observacao($x = 0, $y = 0)
@@ -2930,8 +2928,8 @@  discard block
 block discarded – undo
2930 2928
      * modalRod
2931 2929
      * Monta o campo com os dados do remetente na DACTE. ( retrato  e paisagem  )
2932 2930
      *
2933
-     * @param number $x Posição horizontal canto esquerdo
2934
-     * @param number $y Posição vertical canto superior
2931
+     * @param integer $x Posição horizontal canto esquerdo
2932
+     * @param integer $y Posição vertical canto superior
2935 2933
      * @return number Posição vertical final
2936 2934
      */
2937 2935
     protected function modalRod($x = 0, $y = 0)
@@ -2971,8 +2969,8 @@  discard block
 block discarded – undo
2971 2969
      * modalAereo
2972 2970
      * Monta o campo com os dados do remetente na DACTE. ( retrato  e paisagem  )
2973 2971
      *
2974
-     * @param number $x Posição horizontal canto esquerdo
2975
-     * @param number $y Posição vertical canto superior
2972
+     * @param integer $x Posição horizontal canto esquerdo
2973
+     * @param integer $y Posição vertical canto superior
2976 2974
      * @return number Posição vertical final
2977 2975
      */
2978 2976
     protected function modalAereo($x = 0, $y = 0)
@@ -3028,8 +3026,8 @@  discard block
 block discarded – undo
3028 3026
      * modalAquaviario
3029 3027
      * Monta o campo com os dados do remetente na DACTE. ( retrato  e paisagem  )
3030 3028
      *
3031
-     * @param number $x Posição horizontal canto esquerdo
3032
-     * @param number $y Posição vertical canto superior
3029
+     * @param integer $x Posição horizontal canto esquerdo
3030
+     * @param integer $y Posição vertical canto superior
3033 3031
      * @return number Posição vertical final
3034 3032
      */
3035 3033
     protected function modalAquaviario($x = 0, $y = 0)
@@ -3145,8 +3143,8 @@  discard block
 block discarded – undo
3145 3143
      * modalFerr
3146 3144
      * Monta o campo com os dados do remetente na DACTE. ( retrato  e paisagem  )
3147 3145
      *
3148
-     * @param number $x Posição horizontal canto esquerdo
3149
-     * @param number $y Posição vertical canto superior
3146
+     * @param integer $x Posição horizontal canto esquerdo
3147
+     * @param integer $y Posição vertical canto superior
3150 3148
      * @return number Posição vertical final
3151 3149
      */
3152 3150
     protected function modalFerr($x = 0, $y = 0)
@@ -3423,8 +3421,8 @@  discard block
 block discarded – undo
3423 3421
      * canhoto
3424 3422
      * Monta o campo com os dados do remetente na DACTE.
3425 3423
      *
3426
-     * @param number $x Posição horizontal canto esquerdo
3427
-     * @param number $y Posição vertical canto superior
3424
+     * @param integer $x Posição horizontal canto esquerdo
3425
+     * @param integer $y Posição vertical canto superior
3428 3426
      * @return number Posição vertical final
3429 3427
      */
3430 3428
     protected function canhoto($x = 0, $y = 0)
@@ -3497,9 +3495,10 @@  discard block
 block discarded – undo
3497 3495
      * dadosAdic
3498 3496
      * Coloca o grupo de dados adicionais da DACTE.
3499 3497
      *
3500
-     * @param number $x Posição horizontal canto esquerdo
3501
-     * @param number $y Posição vertical canto superior
3502
-     * @param number $h altura do campo
3498
+     * @param integer $x Posição horizontal canto esquerdo
3499
+     * @param double $y Posição vertical canto superior
3500
+     * @param integer $h altura do campo
3501
+     * @param integer $pag
3503 3502
      * @return number Posição vertical final
3504 3503
      */
3505 3504
     protected function dadosAdic($x, $y, $pag, $h)
@@ -3692,7 +3691,7 @@  discard block
 block discarded – undo
3692 3691
      * Fornece a imformação multiplicação de peso contida na CTe
3693 3692
      *
3694 3693
      * @param interger $U Informação de peso extraida da CTe
3695
-     * @return interger
3694
+     * @return integer
3696 3695
      */
3697 3696
     protected function multiUniPeso($U = '')
3698 3697
     {
Please login to merge, or discard this patch.
Spacing   +6 added lines, -8 removed lines patch added patch discarded remove patch
@@ -945,7 +945,7 @@  discard block
 block discarded – undo
945 945
             $n = count($resp['message']);
946 946
             $alttot = $n * 15;
947 947
             $x = 10;
948
-            $y = $this->hPrint/2 - $alttot/2;
948
+            $y = $this->hPrint / 2 - $alttot / 2;
949 949
             $h = 15;
950 950
             $w = $maxW - (2 * $x);
951 951
             $this->pdf->settextcolor(90, 90, 90);
@@ -1271,8 +1271,7 @@  discard block
 block discarded – undo
1271 1271
             $texto = $this->getTagValue($this->enderExped, "xLgr") . ', ';
1272 1272
             $texto .= $this->getTagValue($this->enderExped, "nro");
1273 1273
             $texto .= $this->getTagValue($this->enderExped, "xCpl") != "" ?
1274
-                ' - ' . $this->getTagValue($this->enderExped, "xCpl") :
1275
-                '';
1274
+                ' - ' . $this->getTagValue($this->enderExped, "xCpl") : '';
1276 1275
         } else {
1277 1276
             $texto = '';
1278 1277
         }
@@ -1368,8 +1367,7 @@  discard block
 block discarded – undo
1368 1367
             $texto = $this->getTagValue($this->enderReceb, "xLgr") . ', ';
1369 1368
             $texto .= $this->getTagValue($this->enderReceb, "nro");
1370 1369
             $texto .= ($this->getTagValue($this->enderReceb, "xCpl") != "") ?
1371
-                ' - ' . $this->getTagValue($this->enderReceb, "xCpl") :
1372
-                '';
1370
+                ' - ' . $this->getTagValue($this->enderReceb, "xCpl") : '';
1373 1371
         } else {
1374 1372
             $texto = '';
1375 1373
         }
@@ -1625,7 +1623,7 @@  discard block
 block discarded – undo
1625 1623
         $qCarga = 0;
1626 1624
         foreach ($this->infQ as $infQ) {
1627 1625
             if ($this->getTagValue($infQ, "cUnid") == '00') {
1628
-                $qCarga += (float)$this->getTagValue($infQ, "qCarga");
1626
+                $qCarga += (float) $this->getTagValue($infQ, "qCarga");
1629 1627
             }
1630 1628
         }
1631 1629
         $texto = !empty($qCarga) ? number_format($qCarga, 3, ",", ".") : '';
@@ -1642,7 +1640,7 @@  discard block
 block discarded – undo
1642 1640
         $qCarga = 0;
1643 1641
         foreach ($this->infQ as $infQ) {
1644 1642
             if ($this->getTagValue($infQ, "cUnid") == '03') {
1645
-                $qCarga += (float)$this->getTagValue($infQ, "qCarga");
1643
+                $qCarga += (float) $this->getTagValue($infQ, "qCarga");
1646 1644
             }
1647 1645
         }
1648 1646
         $texto = !empty($qCarga) ? number_format($qCarga, 3, ",", ".") : '';
@@ -3572,7 +3570,7 @@  discard block
 block discarded – undo
3572 3570
         $y = $y + 5;
3573 3571
         $this->pdf->line($x, $y + 3, $w * 0.255, $y + 3); // LINHA HORIZONTAL ACIMA DO RG ABAIXO DO NOME
3574 3572
         $texto = 'RG';
3575
-        $aFont = ['font' => $this->fontePadrao,'size' => 6,'style' => ''];
3573
+        $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
3576 3574
         $this->pdf->textBox($x, $y + 3, $w * 0.33, $h, $texto, $aFont, 'T', 'L', 0, '');
3577 3575
         $x += $w * 0.85;
3578 3576
         $this->pdf->line($x, $y + 11.5, $x, $y - 5); // LINHA VERTICAL PROXIMO AO CT-E
Please login to merge, or discard this patch.
src/Common/DaCommon.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
             //ativar modo debug
122 122
             error_reporting(E_ALL);
123 123
             ini_set('display_errors', 'On');
124
-            set_error_handler(function (int $errnum, string $errmsg, string $errfile, int $errline) {
124
+            set_error_handler(function(int $errnum, string $errmsg, string $errfile, int $errline) {
125 125
                 throw new \Exception("Erro identificado $errnum: '$errmsg' $errfile [linha:" . $errline . "]");
126 126
             });
127 127
         } else {
@@ -275,7 +275,7 @@  discard block
 block discarded – undo
275 275
         }
276 276
         if (substr($logo, 0, 24) !== 'data://text/plain;base64') {
277 277
             if (is_file($logo)) {
278
-                $logo = 'data://text/plain;base64,'. base64_encode(file_get_contents($logo));
278
+                $logo = 'data://text/plain;base64,' . base64_encode(file_get_contents($logo));
279 279
             } else {
280 280
                 //se não é uma string e nem um file retorna nulo
281 281
                 return null;
@@ -317,7 +317,7 @@  discard block
 block discarded – undo
317 317
         imagedestroy($image);
318 318
         $logo = ob_get_contents(); // read from buffer
319 319
         ob_end_clean();
320
-        return 'data://text/plain;base64,'.base64_encode($logo);
320
+        return 'data://text/plain;base64,' . base64_encode($logo);
321 321
     }
322 322
 
323 323
     /**
Please login to merge, or discard this patch.
src/NFe/Danfe.php 3 patches
Doc Comments   +27 added lines, -19 removed lines patch added patch discarded remove patch
@@ -875,8 +875,8 @@  discard block
 block discarded – undo
875 875
      *header
876 876
      * Monta o cabelhalho da DANFE (retrato e paisagem)
877 877
      *
878
-     * @param number $x      Posição horizontal inicial, canto esquerdo
879
-     * @param number $y      Posição vertical inicial, canto superior
878
+     * @param integer $x      Posição horizontal inicial, canto esquerdo
879
+     * @param integer $y      Posição vertical inicial, canto superior
880 880
      * @param number $pag    Número da Página
881 881
      * @param number $totPag Total de páginas
882 882
      *
@@ -1265,8 +1265,8 @@  discard block
 block discarded – undo
1265 1265
      *
1266 1266
      * @name   destinatarioDANFE
1267 1267
      *
1268
-     * @param number $x Posição horizontal canto esquerdo
1269
-     * @param number $y Posição vertical canto superior
1268
+     * @param integer $x Posição horizontal canto esquerdo
1269
+     * @param integer $y Posição vertical canto superior
1270 1270
      *
1271 1271
      * @return number Posição vertical final
1272 1272
      */
@@ -1480,8 +1480,8 @@  discard block
 block discarded – undo
1480 1480
      *
1481 1481
      * @name   localEntregaDANFE
1482 1482
      *
1483
-     * @param number $x Posição horizontal canto esquerdo
1484
-     * @param number $y Posição vertical canto superior
1483
+     * @param integer $x Posição horizontal canto esquerdo
1484
+     * @param integer $y Posição vertical canto superior
1485 1485
      *
1486 1486
      * @return number Posição vertical final
1487 1487
      */
@@ -1633,8 +1633,8 @@  discard block
 block discarded – undo
1633 1633
      *
1634 1634
      * @name   localretiradaDANFE
1635 1635
      *
1636
-     * @param number $x Posição horizontal canto esquerdo
1637
-     * @param number $y Posição vertical canto superior
1636
+     * @param integer $x Posição horizontal canto esquerdo
1637
+     * @param integer $y Posição vertical canto superior
1638 1638
      *
1639 1639
      * @return number Posição vertical final
1640 1640
      */
@@ -1785,7 +1785,7 @@  discard block
 block discarded – undo
1785 1785
      * Gera a String do Texto da Fatura
1786 1786
      *
1787 1787
      * @name   getTextoFatura
1788
-     * @return uma String com o texto ou "";
1788
+     * @return string String com o texto ou "";
1789 1789
      */
1790 1790
     protected function getTextoFatura()
1791 1791
     {
@@ -1843,8 +1843,8 @@  discard block
 block discarded – undo
1843 1843
      *
1844 1844
      * @name   fatura
1845 1845
      *
1846
-     * @param number $x Posição horizontal canto esquerdo
1847
-     * @param number $y Posição vertical canto superior
1846
+     * @param integer $x Posição horizontal canto esquerdo
1847
+     * @param double $y Posição vertical canto superior
1848 1848
      *
1849 1849
      * @return number Posição vertical final
1850 1850
      */
@@ -1971,8 +1971,8 @@  discard block
 block discarded – undo
1971 1971
      *
1972 1972
      * @name   pagamento
1973 1973
      *
1974
-     * @param number $x Posição horizontal canto esquerdo
1975
-     * @param number $y Posição vertical canto superior
1974
+     * @param integer $x Posição horizontal canto esquerdo
1975
+     * @param double $y Posição vertical canto superior
1976 1976
      *
1977 1977
      * @return number Posição vertical final
1978 1978
      */
@@ -2105,6 +2105,8 @@  discard block
 block discarded – undo
2105 2105
      * @param float $h Altura do campo
2106 2106
      * @param float $h Título do campo
2107 2107
      * @param float $h Valor do imposto
2108
+     * @param string $titulo
2109
+     * @param string $campoImposto
2108 2110
      *
2109 2111
      * @return float Sugestão do $x do próximo imposto
2110 2112
      */
@@ -2133,10 +2135,10 @@  discard block
 block discarded – undo
2133 2135
      * imposto
2134 2136
      * Monta o campo de impostos e totais da DANFE (retrato e paisagem)
2135 2137
      *
2136
-     * @param number $x Posição horizontal canto esquerdo
2137
-     * @param number $y Posição vertical canto superior
2138
+     * @param integer $x Posição horizontal canto esquerdo
2139
+     * @param double $y Posição vertical canto superior
2138 2140
      *
2139
-     * @return number Posição vertical final
2141
+     * @return double Posição vertical final
2140 2142
      */
2141 2143
     protected function imposto($x, $y)
2142 2144
     {
@@ -2531,6 +2533,10 @@  discard block
 block discarded – undo
2531 2533
     } //fim transporte
2532 2534
 
2533 2535
 
2536
+    /**
2537
+     * @param string $campo
2538
+     * @param string $formato
2539
+     */
2534 2540
     protected function descricaoProdutoHelper($origem, $campo, $formato)
2535 2541
     {
2536 2542
         $valor_original = $origem->getElementsByTagName($campo)->item(0);
@@ -2640,7 +2646,6 @@  discard block
 block discarded – undo
2640 2646
      * @param float $x       Posição horizontal canto esquerdo
2641 2647
      * @param float $y       Posição vertical canto superior
2642 2648
      * @param float $nInicio Número do item inicial
2643
-     * @param float $max     Número do item final
2644 2649
      * @param float $hmax    Altura máxima do campo de itens em mm
2645 2650
      *
2646 2651
      * @return float Posição vertical final
@@ -3385,8 +3390,8 @@  discard block
 block discarded – undo
3385 3390
      *
3386 3391
      * @name   canhotoDANFE
3387 3392
      *
3388
-     * @param number $x Posição horizontal canto esquerdo
3389
-     * @param number $y Posição vertical canto superior
3393
+     * @param integer $x Posição horizontal canto esquerdo
3394
+     * @param integer $y Posição vertical canto superior
3390 3395
      *
3391 3396
      * @return number Posição vertical final
3392 3397
      *
@@ -3691,6 +3696,9 @@  discard block
 block discarded – undo
3691 3696
         return $saida;
3692 3697
     }
3693 3698
 
3699
+    /**
3700
+     * @param string $xml
3701
+     */
3694 3702
     private function loadDoc($xml)
3695 3703
     {
3696 3704
         $this->xml = $xml;
Please login to merge, or discard this patch.
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -64,11 +64,11 @@
 block discarded – undo
64 64
      * @var boolean
65 65
      */
66 66
     protected $descProdQuebraLinha = true;
67
-     /**
68
-     * Parâmetro para ocultar a unidade tributável nos itens
69
-     *
70
-     * @var boolean
71
-     */
67
+        /**
68
+         * Parâmetro para ocultar a unidade tributável nos itens
69
+         *
70
+         * @var boolean
71
+         */
72 72
     protected $ocultarUnidadeTributavel = false;
73 73
     /**
74 74
      * XML NFe
Please login to merge, or discard this patch.
Spacing   +225 added lines, -226 removed lines patch added patch discarded remove patch
@@ -343,28 +343,28 @@  discard block
 block discarded – undo
343 343
     {
344 344
         $this->textoAdic = '';
345 345
         //informações adicionais
346
-        $fontProduto            = [
346
+        $fontProduto = [
347 347
             'font'  => $this->fontePadrao,
348 348
             'size'  => 8,
349 349
             'style' => ''
350 350
         ];
351 351
         $k                      = $this->pdf->k;
352 352
         $this->textadicfontsize = $fontProduto['size'] / $k;
353
-        $this->textoAdic        .= $this->geraInformacoesDasNotasReferenciadas();
353
+        $this->textoAdic .= $this->geraInformacoesDasNotasReferenciadas();
354 354
         if (isset($this->infAdic)) {
355 355
             $i = 0;
356 356
             if ($this->textoAdic != '') {
357 357
                 $this->textoAdic .= ". \n";
358 358
             }
359
-            $this->textoAdic .= ! empty($this->getTagValue($this->infAdic, "infCpl"))
359
+            $this->textoAdic .= !empty($this->getTagValue($this->infAdic, "infCpl"))
360 360
                 ? 'Inf. Contribuinte: ' . $this->anfaveaDANFE($this->getTagValue($this->infAdic, "infCpl"))
361 361
                 : '';
362
-            $infPedido       = $this->geraInformacoesDaTagCompra();
362
+            $infPedido = $this->geraInformacoesDaTagCompra();
363 363
             if ($infPedido != "") {
364 364
                 $this->textoAdic .= $infPedido;
365 365
             }
366 366
             $this->textoAdic .= $this->getTagValue($this->dest, "email", ' Email do Destinatário: ');
367
-            $this->textoAdic .= ! empty($this->getTagValue($this->infAdic, "infAdFisco"))
367
+            $this->textoAdic .= !empty($this->getTagValue($this->infAdic, "infAdFisco"))
368 368
                 ? "\n Inf. fisco: " . $this->getTagValue($this->infAdic, "infAdFisco")
369 369
                 : '';
370 370
             if ($this->obsshow) {
@@ -372,11 +372,11 @@  discard block
 block discarded – undo
372 372
                 if (isset($obsCont)) {
373 373
                     foreach ($obsCont as $obs) {
374 374
                         $campo = $obsCont->item($i)->getAttribute("xCampo");
375
-                        $xTexto = ! empty($obsCont->item($i)->getElementsByTagName("xTexto")->item(0)->nodeValue)
375
+                        $xTexto = !empty($obsCont->item($i)->getElementsByTagName("xTexto")->item(0)->nodeValue)
376 376
                             ? $obsCont->item($i)->getElementsByTagName("xTexto")->item(0)->nodeValue
377 377
                             : '';
378 378
                         $this->textoAdic .= "\n" . $campo . ':  ' . trim($xTexto);
379
-                        $i ++;
379
+                        $i++;
380 380
                     }
381 381
                 }
382 382
             }
@@ -391,7 +391,7 @@  discard block
 block discarded – undo
391 391
             $flagVTT  = $flagVTT && (strpos(strtolower(trim($this->textoAdic)), 'trib') ||
392 392
                     strpos(strtolower(trim($this->textoAdic)), 'imp'));
393 393
             $vTotTrib = $this->getTagValue($this->ICMSTot, 'vTotTrib');
394
-            if ($vTotTrib != '' && ! $flagVTT) {
394
+            if ($vTotTrib != '' && !$flagVTT) {
395 395
                 $this->textoAdic .= "\n Valor Aproximado dos Tributos : R$ "
396 396
                     . number_format($vTotTrib, 2, ",", ".");
397 397
             }
@@ -402,9 +402,9 @@  discard block
 block discarded – undo
402 402
         $this->textadicfontsize = $this->pdf->fontSize;
403 403
         $hdadosadic             = ceil($numlinhasdados * ($this->textadicfontsize));
404 404
         if ($hdadosadic > 70) {
405
-            for ($f = 8; $f > 3; $f --) {
405
+            for ($f = 8; $f > 3; $f--) {
406 406
                 $this->pdf->setFont($this->fontePadrao, '', $f);
407
-                $fontProduto            = [
407
+                $fontProduto = [
408 408
                     'font'  => $this->fontePadrao,
409 409
                     'size'  => $f,
410 410
                     'style' => ''
@@ -527,9 +527,9 @@  discard block
 block discarded – undo
527 527
         $this->hdadosadic = $this->calculoEspacoVericalDadosAdicionais();
528 528
 
529 529
         //altura disponivel para os campos da DANFE
530
-        $hcabecalho    = 47;//para cabeçalho
531
-        $hdestinatario = 25;//para destinatario
532
-        $hduplicatas   = 12;//para cada grupo de 7 duplicatas
530
+        $hcabecalho    = 47; //para cabeçalho
531
+        $hdestinatario = 25; //para destinatario
532
+        $hduplicatas   = 12; //para cada grupo de 7 duplicatas
533 533
         if (isset($this->entrega)) {
534 534
             $hlocalentrega = 25;
535 535
         } else {
@@ -540,11 +540,11 @@  discard block
 block discarded – undo
540 540
         } else {
541 541
             $hlocalretirada = 0;
542 542
         }
543
-        $himposto    = 18;// para imposto
544
-        $htransporte = 25;// para transporte
545
-        $hissqn      = 11;// para issqn
546
-        $hfooter     = 5;// para rodape
547
-        $hCabecItens = 4;//cabeçalho dos itens
543
+        $himposto    = 18; // para imposto
544
+        $htransporte = 25; // para transporte
545
+        $hissqn      = 11; // para issqn
546
+        $hfooter     = 5; // para rodape
547
+        $hCabecItens = 4; //cabeçalho dos itens
548 548
         $hOCUPADA    = $hcabecalho
549 549
             + $hdestinatario
550 550
             + $hlocalentrega
@@ -567,10 +567,10 @@  discard block
 block discarded – undo
567 567
         $this->sizeExtraTextoFatura());*/
568 568
 
569 569
         if ($this->orientacao == 'P') {
570
-            $hDispo1 -= 24 * $this->qCanhoto;//para canhoto
571
-            $w       = $this->wPrint;
570
+            $hDispo1 -= 24 * $this->qCanhoto; //para canhoto
571
+            $w = $this->wPrint;
572 572
         } else {
573
-            $hcanhoto = $this->hPrint;//para canhoto
573
+            $hcanhoto = $this->hPrint; //para canhoto
574 574
             $w        = $this->wPrint - $this->wCanhoto;
575 575
         }
576 576
         //$hDispo1 += 14;
@@ -606,12 +606,12 @@  discard block
 block discarded – undo
606 606
             );
607 607
             $hUsado += $this->calculeHeight($itemProd, $mostrarUnidadeTributavel);
608 608
             if ($hUsado > $hDispo) {
609
-                $totPag ++;
609
+                $totPag++;
610 610
                 $hDispo = $hDispo2;
611 611
                 $hUsado = $hCabecItens;
612
-                $i --; // decrementa para readicionar o item que não coube nessa pagina na outra.
612
+                $i--; // decrementa para readicionar o item que não coube nessa pagina na outra.
613 613
             }
614
-            $i ++;
614
+            $i++;
615 615
         } //fim da soma das areas de itens usadas
616 616
         $qtdeItens = $i; //controle da quantidade de itens no DANFE
617 617
         //montagem da primeira página
@@ -643,7 +643,7 @@  discard block
 block discarded – undo
643 643
         $formaPag = [];
644 644
         if (isset($this->detPag) && $this->detPag->length > 0) {
645 645
             foreach ($this->detPag as $k => $d) {
646
-                $fPag            = ! empty($this->detPag->item($k)->getElementsByTagName('tPag')->item(0)->nodeValue)
646
+                $fPag            = !empty($this->detPag->item($k)->getElementsByTagName('tPag')->item(0)->nodeValue)
647 647
                     ? $this->detPag->item($k)->getElementsByTagName('tPag')->item(0)->nodeValue
648 648
                     : '0';
649 649
                 $formaPag[$fPag] = $fPag;
@@ -687,7 +687,7 @@  discard block
 block discarded – undo
687 687
         }
688 688
 
689 689
         //loop para páginas seguintes
690
-        for ($n = 2; $n <= $totPag; $n ++) {
690
+        for ($n = 2; $n <= $totPag; $n++) {
691 691
             // fixa as margens
692 692
             $this->pdf->setMargins($this->margesq, $this->margsup);
693 693
             //adiciona nova página
@@ -711,7 +711,7 @@  discard block
 block discarded – undo
711 711
             }
712 712
             //se estiver na última página e ainda restar itens para inserir, adiciona mais uma página
713 713
             if ($n == $totPag && $this->qtdeItensProc < $qtdeItens) {
714
-                $totPag ++;
714
+                $totPag++;
715 715
             }
716 716
         }
717 717
     }
@@ -740,7 +740,7 @@  discard block
 block discarded – undo
740 740
         if ($startPos === false) {
741 741
             return $cdata;
742 742
         }
743
-        for ($x = $len; $x > 0; $x --) {
743
+        for ($x = $len; $x > 0; $x--) {
744 744
             if (substr($cdata, $x, 1) == '>') {
745 745
                 $endPos = $x;
746 746
                 break;
@@ -836,15 +836,15 @@  discard block
 block discarded – undo
836 836
         //grupo CADATA infCpl
837 837
         $t          = $dom->getElementsByTagName('transmissor')->item(0);
838 838
         $r          = $dom->getElementsByTagName('receptor')->item(0);
839
-        $versao     = ! empty($dom->getElementsByTagName('versao')->item(0)->nodeValue) ?
839
+        $versao     = !empty($dom->getElementsByTagName('versao')->item(0)->nodeValue) ?
840 840
             'Versao:' . $dom->getElementsByTagName('versao')->item(0)->nodeValue . ' ' : '';
841
-        $especieNF  = ! empty($dom->getElementsByTagName('especieNF')->item(0)->nodeValue) ?
841
+        $especieNF  = !empty($dom->getElementsByTagName('especieNF')->item(0)->nodeValue) ?
842 842
             'Especie:' . $dom->getElementsByTagName('especieNF')->item(0)->nodeValue . ' ' : '';
843
-        $fabEntrega = ! empty($dom->getElementsByTagName('fabEntrega')->item(0)->nodeValue) ?
843
+        $fabEntrega = !empty($dom->getElementsByTagName('fabEntrega')->item(0)->nodeValue) ?
844 844
             'Entrega:' . $dom->getElementsByTagName('fabEntrega')->item(0)->nodeValue . ' ' : '';
845
-        $dca        = ! empty($dom->getElementsByTagName('dca')->item(0)->nodeValue) ?
845
+        $dca        = !empty($dom->getElementsByTagName('dca')->item(0)->nodeValue) ?
846 846
             'dca:' . $dom->getElementsByTagName('dca')->item(0)->nodeValue . ' ' : '';
847
-        $texto      .= "" . $versao . $especieNF . $fabEntrega . $dca;
847
+        $texto .= "" . $versao . $especieNF . $fabEntrega . $dca;
848 848
         if (isset($t)) {
849 849
             if ($t->hasAttributes()) {
850 850
                 $texto .= " Transmissor ";
@@ -890,7 +890,7 @@  discard block
 block discarded – undo
890 890
         } else {
891 891
             if ($this->getTagValue($this->ide, "tpAmb") == '2') {
892 892
                 $resp['status'] = false;
893
-                $resp['message'][] =  "NFe EMITIDA EM HOMOLOGAÇÃO";
893
+                $resp['message'][] = "NFe EMITIDA EM HOMOLOGAÇÃO";
894 894
             }
895 895
             $retEvento = $this->nfeProc->getElementsByTagName('retEvento')->item(0);
896 896
             $cStat = $this->getTagValue($this->nfeProc, "cStat");
@@ -911,7 +911,7 @@  discard block
 block discarded – undo
911 911
             } elseif (!empty($retEvento)) {
912 912
                 $infEvento = $retEvento->getElementsByTagName('infEvento')->item(0);
913 913
                 $cStat = $this->getTagValue($infEvento, "cStat");
914
-                $tpEvento= $this->getTagValue($infEvento, "tpEvento");
914
+                $tpEvento = $this->getTagValue($infEvento, "tpEvento");
915 915
                 $dhEvento = $this->toDateTime($this->getTagValue($infEvento, "dhRegEvento"))->format("d/m/Y H:i:s");
916 916
                 $nProt = $this->getTagValue($infEvento, "nProt");
917 917
                 if ($tpEvento == '110111' &&
@@ -975,7 +975,7 @@  discard block
 block discarded – undo
975 975
         //se for right separa 2/3 para os dados e o terço seguinte para o logo
976 976
         //se não houver logo centraliza dos dados do emitente
977 977
         // coloca o logo
978
-        if (! empty($this->logomarca)) {
978
+        if (!empty($this->logomarca)) {
979 979
             $logoInfo = getimagesize($this->logomarca);
980 980
             //largura da imagem em mm
981 981
             $logoWmm = ($logoInfo[0] / 72) * 25.4;
@@ -1031,7 +1031,7 @@  discard block
 block discarded – undo
1031 1031
             //endereço
1032 1032
             $y1     = $y1 + 5;
1033 1033
             $aFont  = ['font' => $this->fontePadrao, 'size' => 8, 'style' => ''];
1034
-            $fone   = ! empty($this->enderEmit->getElementsByTagName("fone")->item(0)->nodeValue)
1034
+            $fone   = !empty($this->enderEmit->getElementsByTagName("fone")->item(0)->nodeValue)
1035 1035
                 ? $this->enderEmit->getElementsByTagName("fone")->item(0)->nodeValue
1036 1036
                 : '';
1037 1037
             $lgr    = $this->getTagValue($this->enderEmit, "xLgr");
@@ -1050,8 +1050,8 @@  discard block
 block discarded – undo
1050 1050
 
1051 1051
         //####################################################################################
1052 1052
         //coluna central Danfe
1053
-        $x  += $w;
1054
-        $w  = round($maxW * 0.17, 0);//35;
1053
+        $x += $w;
1054
+        $w  = round($maxW * 0.17, 0); //35;
1055 1055
         $w2 = $w;
1056 1056
         $h  = 32;
1057 1057
         $this->pdf->textBox($x, $y, $w, $h);
@@ -1108,8 +1108,8 @@  discard block
 block discarded – undo
1108 1108
 
1109 1109
         //####################################################################################
1110 1110
         //coluna codigo de barras
1111
-        $x  += $w;
1112
-        $w  = ($maxW - $w1 - $w2);//85;
1111
+        $x += $w;
1112
+        $w  = ($maxW - $w1 - $w2); //85;
1113 1113
         $w3 = $w;
1114 1114
         $h  = 32;
1115 1115
         $this->pdf->textBox($x, $y, $w, $h);
@@ -1171,7 +1171,7 @@  discard block
 block discarded – undo
1171 1171
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
1172 1172
         $w     = $w1 + $w2;
1173 1173
         $y     = $oldY;
1174
-        $oldY  += $h;
1174
+        $oldY += $h;
1175 1175
         $x     = $oldX;
1176 1176
         $h     = 7;
1177 1177
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
@@ -1202,7 +1202,7 @@  discard block
 block discarded – undo
1202 1202
                 $cStat = '';
1203 1203
             } else {
1204 1204
                 if (isset($this->nfeProc)) {
1205
-                    $texto  = ! empty($this->nfeProc->getElementsByTagName("nProt")->item(0)->nodeValue)
1205
+                    $texto  = !empty($this->nfeProc->getElementsByTagName("nProt")->item(0)->nodeValue)
1206 1206
                         ? $this->nfeProc->getElementsByTagName("nProt")->item(0)->nodeValue
1207 1207
                         : '';
1208 1208
                     $dtHora = $this->toDateTime(
@@ -1232,7 +1232,7 @@  discard block
 block discarded – undo
1232 1232
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1233 1233
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1234 1234
         //INSCRIÇÃO MUNICIPAL
1235
-        $x     += $w;
1235
+        $x += $w;
1236 1236
         $texto = 'INSCRIÇÃO MUNICIPAL';
1237 1237
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
1238 1238
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
@@ -1240,29 +1240,29 @@  discard block
 block discarded – undo
1240 1240
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1241 1241
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1242 1242
         //INSCRIÇÃO ESTADUAL DO SUBST. TRIBUT.
1243
-        $x     += $w;
1243
+        $x += $w;
1244 1244
         $texto = 'INSCRIÇÃO ESTADUAL DO SUBST. TRIBUT.';
1245 1245
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
1246 1246
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1247
-        $texto = ! empty($this->emit->getElementsByTagName("IEST")->item(0)->nodeValue)
1247
+        $texto = !empty($this->emit->getElementsByTagName("IEST")->item(0)->nodeValue)
1248 1248
             ? $this->emit->getElementsByTagName("IEST")->item(0)->nodeValue
1249 1249
             : '';
1250 1250
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1251 1251
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1252 1252
         //CNPJ
1253
-        $x     += $w;
1253
+        $x += $w;
1254 1254
         $w     = ($maxW - (3 * $w));
1255 1255
         $texto = 'CNPJ / CPF';
1256 1256
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
1257 1257
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1258 1258
         //Pegando valor do CPF/CNPJ
1259
-        if (! empty($this->emit->getElementsByTagName("CNPJ")->item(0)->nodeValue)) {
1259
+        if (!empty($this->emit->getElementsByTagName("CNPJ")->item(0)->nodeValue)) {
1260 1260
             $texto = $this->formatField(
1261 1261
                 $this->emit->getElementsByTagName("CNPJ")->item(0)->nodeValue,
1262 1262
                 "###.###.###/####-##"
1263 1263
             );
1264 1264
         } else {
1265
-            $texto = ! empty($this->emit->getElementsByTagName("CPF")->item(0)->nodeValue)
1265
+            $texto = !empty($this->emit->getElementsByTagName("CPF")->item(0)->nodeValue)
1266 1266
                 ? $this->formatField(
1267 1267
                     $this->emit->getElementsByTagName("CPF")->item(0)->nodeValue,
1268 1268
                     "###.###.###-##"
@@ -1281,7 +1281,7 @@  discard block
 block discarded – undo
1281 1281
             $n = count($resp['message']);
1282 1282
             $alttot = $n * 15;
1283 1283
             $x = 10;
1284
-            $y = $this->hPrint/2 - $alttot/2;
1284
+            $y = $this->hPrint / 2 - $alttot / 2;
1285 1285
             $h = 15;
1286 1286
             $w = $maxW - (2 * $x);
1287 1287
             $this->pdf->settextcolor(90, 90, 90);
@@ -1354,7 +1354,7 @@  discard block
 block discarded – undo
1354 1354
         //NOME / RAZÃO SOCIAL
1355 1355
         $w     = round($maxW * 0.61, 0);
1356 1356
         $w1    = $w;
1357
-        $y     += 3;
1357
+        $y += 3;
1358 1358
         $texto = 'NOME / RAZÃO SOCIAL';
1359 1359
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
1360 1360
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
@@ -1366,20 +1366,20 @@  discard block
 block discarded – undo
1366 1366
             $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 1, '');
1367 1367
         }
1368 1368
         //CNPJ / CPF
1369
-        $x     += $w;
1369
+        $x += $w;
1370 1370
         $w     = round($maxW * 0.23, 0);
1371 1371
         $w2    = $w;
1372 1372
         $texto = 'CNPJ / CPF';
1373 1373
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
1374 1374
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1375 1375
         //Pegando valor do CPF/CNPJ
1376
-        if (! empty($this->dest->getElementsByTagName("CNPJ")->item(0)->nodeValue)) {
1376
+        if (!empty($this->dest->getElementsByTagName("CNPJ")->item(0)->nodeValue)) {
1377 1377
             $texto = $this->formatField(
1378 1378
                 $this->dest->getElementsByTagName("CNPJ")->item(0)->nodeValue,
1379 1379
                 "###.###.###/####-##"
1380 1380
             );
1381 1381
         } else {
1382
-            $texto = ! empty($this->dest->getElementsByTagName("CPF")->item(0)->nodeValue)
1382
+            $texto = !empty($this->dest->getElementsByTagName("CPF")->item(0)->nodeValue)
1383 1383
                 ? $this->formatField(
1384 1384
                     $this->dest->getElementsByTagName("CPF")->item(0)->nodeValue,
1385 1385
                     "###.###.###-##"
@@ -1389,17 +1389,17 @@  discard block
 block discarded – undo
1389 1389
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1390 1390
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1391 1391
         //DATA DA EMISSÃO
1392
-        $x     += $w;
1392
+        $x += $w;
1393 1393
         $w     = $maxW - ($w1 + $w2);
1394 1394
         $wx    = $w;
1395 1395
         $texto = 'DATA DA EMISSÃO';
1396 1396
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
1397 1397
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1398
-        $dEmi = ! empty($this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue)
1398
+        $dEmi = !empty($this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue)
1399 1399
             ? $this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue
1400 1400
             : '';
1401 1401
         if ($dEmi == '') {
1402
-            $dEmi  = ! empty($this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue)
1402
+            $dEmi  = !empty($this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue)
1403 1403
                 ? $this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue
1404 1404
                 : '';
1405 1405
             $aDemi = explode('T', $dEmi);
@@ -1415,7 +1415,7 @@  discard block
 block discarded – undo
1415 1415
         //ENDEREÇO
1416 1416
         $w     = round($maxW * 0.47, 0);
1417 1417
         $w1    = $w;
1418
-        $y     += $h;
1418
+        $y += $h;
1419 1419
         $x     = $oldX;
1420 1420
         $texto = 'ENDEREÇO';
1421 1421
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
@@ -1427,7 +1427,7 @@  discard block
 block discarded – undo
1427 1427
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1428 1428
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 0, '', true);
1429 1429
         //BAIRRO / DISTRITO
1430
-        $x     += $w;
1430
+        $x += $w;
1431 1431
         $w     = round($maxW * 0.21, 0);
1432 1432
         $w2    = $w;
1433 1433
         $texto = 'BAIRRO / DISTRITO';
@@ -1437,29 +1437,29 @@  discard block
 block discarded – undo
1437 1437
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1438 1438
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1439 1439
         //CEP
1440
-        $x     += $w;
1440
+        $x += $w;
1441 1441
         $w     = $maxW - $w1 - $w2 - $wx;
1442 1442
         $w2    = $w;
1443 1443
         $texto = 'CEP';
1444 1444
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
1445 1445
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1446
-        $texto = ! empty($this->dest->getElementsByTagName("CEP")->item(0)->nodeValue)
1446
+        $texto = !empty($this->dest->getElementsByTagName("CEP")->item(0)->nodeValue)
1447 1447
             ? $this->dest->getElementsByTagName("CEP")->item(0)->nodeValue
1448 1448
             : '';
1449 1449
         $texto = $this->formatField($texto, "#####-###");
1450 1450
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1451 1451
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1452 1452
         //DATA DA SAÍDA
1453
-        $x     += $w;
1453
+        $x += $w;
1454 1454
         $w     = $wx;
1455 1455
         $texto = 'DATA DA SAÍDA/ENTRADA';
1456 1456
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
1457 1457
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1458
-        $dSaiEnt = ! empty($this->ide->getElementsByTagName("dSaiEnt")->item(0)->nodeValue)
1458
+        $dSaiEnt = !empty($this->ide->getElementsByTagName("dSaiEnt")->item(0)->nodeValue)
1459 1459
             ? $this->ide->getElementsByTagName("dSaiEnt")->item(0)->nodeValue
1460 1460
             : '';
1461 1461
         if ($dSaiEnt == '') {
1462
-            $dSaiEnt  = ! empty($this->ide->getElementsByTagName("dhSaiEnt")->item(0)->nodeValue)
1462
+            $dSaiEnt  = !empty($this->ide->getElementsByTagName("dhSaiEnt")->item(0)->nodeValue)
1463 1463
                 ? $this->ide->getElementsByTagName("dhSaiEnt")->item(0)->nodeValue
1464 1464
                 : '';
1465 1465
             $aDsaient = explode('T', $dSaiEnt);
@@ -1470,7 +1470,7 @@  discard block
 block discarded – undo
1470 1470
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1471 1471
         //MUNICÍPIO
1472 1472
         $w     = $w1;
1473
-        $y     += $h;
1473
+        $y += $h;
1474 1474
         $x     = $oldX;
1475 1475
         $texto = 'MUNICÍPIO';
1476 1476
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
@@ -1484,7 +1484,7 @@  discard block
 block discarded – undo
1484 1484
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1485 1485
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 0, '');
1486 1486
         //UF
1487
-        $x     += $w;
1487
+        $x += $w;
1488 1488
         $w     = 8;
1489 1489
         $texto = 'UF';
1490 1490
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
@@ -1493,19 +1493,19 @@  discard block
 block discarded – undo
1493 1493
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1494 1494
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1495 1495
         //FONE / FAX
1496
-        $x     += $w;
1496
+        $x += $w;
1497 1497
         $w     = round(($maxW - $w1 - $wx - 8) / 2, 0);
1498 1498
         $w3    = $w;
1499 1499
         $texto = 'FONE / FAX';
1500 1500
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
1501 1501
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1502
-        $texto = ! empty($this->dest->getElementsByTagName("fone")->item(0)->nodeValue)
1502
+        $texto = !empty($this->dest->getElementsByTagName("fone")->item(0)->nodeValue)
1503 1503
             ? $this->dest->getElementsByTagName("fone")->item(0)->nodeValue
1504 1504
             : '';
1505 1505
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1506 1506
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1507 1507
         //INSCRIÇÃO ESTADUAL
1508
-        $x     += $w;
1508
+        $x += $w;
1509 1509
         $w     = $maxW - $w1 - $wx - 8 - $w3;
1510 1510
         $texto = 'INSCRIÇÃO ESTADUAL';
1511 1511
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
@@ -1515,16 +1515,16 @@  discard block
 block discarded – undo
1515 1515
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1516 1516
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1517 1517
         //HORA DA SAÍDA
1518
-        $x     += $w;
1518
+        $x += $w;
1519 1519
         $w     = $wx;
1520 1520
         $texto = 'HORA DA SAÍDA/ENTRADA';
1521 1521
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
1522 1522
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1523
-        $hSaiEnt = ! empty($this->ide->getElementsByTagName("hSaiEnt")->item(0)->nodeValue)
1523
+        $hSaiEnt = !empty($this->ide->getElementsByTagName("hSaiEnt")->item(0)->nodeValue)
1524 1524
             ? $this->ide->getElementsByTagName("hSaiEnt")->item(0)->nodeValue
1525 1525
             : '';
1526 1526
         if ($hSaiEnt == '') {
1527
-            $dhSaiEnt   = ! empty($this->ide->getElementsByTagName("dhSaiEnt")->item(0)->nodeValue)
1527
+            $dhSaiEnt   = !empty($this->ide->getElementsByTagName("dhSaiEnt")->item(0)->nodeValue)
1528 1528
                 ? $this->ide->getElementsByTagName("dhSaiEnt")->item(0)->nodeValue
1529 1529
                 : '';
1530 1530
             $tsDhSaiEnt = $this->toDateTime($dhSaiEnt);
@@ -1568,7 +1568,7 @@  discard block
 block discarded – undo
1568 1568
         //NOME / RAZÃO SOCIAL
1569 1569
         $w     = round($maxW * 0.61, 0);
1570 1570
         $w1    = $w;
1571
-        $y     += 3;
1571
+        $y += 3;
1572 1572
         $texto = 'NOME / RAZÃO SOCIAL';
1573 1573
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
1574 1574
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
@@ -1583,20 +1583,20 @@  discard block
 block discarded – undo
1583 1583
             $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 1, '');
1584 1584
         }
1585 1585
         //CNPJ / CPF
1586
-        $x     += $w;
1586
+        $x += $w;
1587 1587
         $w     = round($maxW * 0.23, 0);
1588 1588
         $w2    = $w;
1589 1589
         $texto = 'CNPJ / CPF';
1590 1590
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
1591 1591
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1592 1592
         //Pegando valor do CPF/CNPJ
1593
-        if (! empty($this->entrega->getElementsByTagName("CNPJ")->item(0)->nodeValue)) {
1593
+        if (!empty($this->entrega->getElementsByTagName("CNPJ")->item(0)->nodeValue)) {
1594 1594
             $texto = $this->formatField(
1595 1595
                 $this->entrega->getElementsByTagName("CNPJ")->item(0)->nodeValue,
1596 1596
                 "###.###.###/####-##"
1597 1597
             );
1598 1598
         } else {
1599
-            $texto = ! empty($this->entrega->getElementsByTagName("CPF")->item(0)->nodeValue) ?
1599
+            $texto = !empty($this->entrega->getElementsByTagName("CPF")->item(0)->nodeValue) ?
1600 1600
                 $this->formatField(
1601 1601
                     $this->entrega->getElementsByTagName("CPF")->item(0)->nodeValue,
1602 1602
                     "###.###.###-##"
@@ -1605,7 +1605,7 @@  discard block
 block discarded – undo
1605 1605
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1606 1606
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1607 1607
         //INSCRIÇÃO ESTADUAL
1608
-        $x     += $w;
1608
+        $x += $w;
1609 1609
         $w     = $maxW - ($w1 + $w2);
1610 1610
         $wx    = $w;
1611 1611
         $texto = 'INSCRIÇÃO ESTADUAL';
@@ -1624,7 +1624,7 @@  discard block
 block discarded – undo
1624 1624
         //ENDEREÇO
1625 1625
         $w     = round($maxW * 0.355, 0) + $wx;
1626 1626
         $w1    = $w;
1627
-        $y     += $h;
1627
+        $y += $h;
1628 1628
         $x     = $oldX;
1629 1629
         $texto = 'ENDEREÇO';
1630 1630
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
@@ -1635,7 +1635,7 @@  discard block
 block discarded – undo
1635 1635
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1636 1636
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 0, '', true);
1637 1637
         //BAIRRO / DISTRITO
1638
-        $x     += $w;
1638
+        $x += $w;
1639 1639
         $w     = round($maxW * 0.335, 0);
1640 1640
         $w2    = $w;
1641 1641
         $texto = 'BAIRRO / DISTRITO';
@@ -1645,12 +1645,12 @@  discard block
 block discarded – undo
1645 1645
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1646 1646
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1647 1647
         //CEP
1648
-        $x     += $w;
1648
+        $x += $w;
1649 1649
         $w     = $maxW - ($w1 + $w2);
1650 1650
         $texto = 'CEP';
1651 1651
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
1652 1652
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1653
-        $texto = ! empty($this->entrega->getElementsByTagName("CEP")->item(0)->nodeValue) ?
1653
+        $texto = !empty($this->entrega->getElementsByTagName("CEP")->item(0)->nodeValue) ?
1654 1654
             $this->entrega->getElementsByTagName("CEP")->item(0)->nodeValue : '';
1655 1655
         $texto = $this->formatField($texto, "#####-###");
1656 1656
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
@@ -1658,7 +1658,7 @@  discard block
 block discarded – undo
1658 1658
         //MUNICÍPIO
1659 1659
         $w     = round($maxW * 0.805, 0);
1660 1660
         $w1    = $w;
1661
-        $y     += $h;
1661
+        $y += $h;
1662 1662
         $x     = $oldX;
1663 1663
         $texto = 'MUNICÍPIO';
1664 1664
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
@@ -1670,7 +1670,7 @@  discard block
 block discarded – undo
1670 1670
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1671 1671
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 0, '');
1672 1672
         //UF
1673
-        $x     += $w;
1673
+        $x += $w;
1674 1674
         $w     = 8;
1675 1675
         $texto = 'UF';
1676 1676
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
@@ -1679,12 +1679,12 @@  discard block
 block discarded – undo
1679 1679
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1680 1680
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1681 1681
         //FONE / FAX
1682
-        $x     += $w;
1682
+        $x += $w;
1683 1683
         $w     = $maxW - $w - $w1;
1684 1684
         $texto = 'FONE / FAX';
1685 1685
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
1686 1686
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1687
-        $texto = ! empty($this->entrega->getElementsByTagName("fone")->item(0)->nodeValue) ?
1687
+        $texto = !empty($this->entrega->getElementsByTagName("fone")->item(0)->nodeValue) ?
1688 1688
             $this->entrega->getElementsByTagName("fone")->item(0)->nodeValue : '';
1689 1689
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1690 1690
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
@@ -1721,7 +1721,7 @@  discard block
 block discarded – undo
1721 1721
         //NOME / RAZÃO SOCIAL
1722 1722
         $w     = round($maxW * 0.61, 0);
1723 1723
         $w1    = $w;
1724
-        $y     += 3;
1724
+        $y += 3;
1725 1725
         $texto = 'NOME / RAZÃO SOCIAL';
1726 1726
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
1727 1727
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
@@ -1736,20 +1736,20 @@  discard block
 block discarded – undo
1736 1736
             $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 1, '');
1737 1737
         }
1738 1738
         //CNPJ / CPF
1739
-        $x     += $w;
1739
+        $x += $w;
1740 1740
         $w     = round($maxW * 0.23, 0);
1741 1741
         $w2    = $w;
1742 1742
         $texto = 'CNPJ / CPF';
1743 1743
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
1744 1744
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1745 1745
         //Pegando valor do CPF/CNPJ
1746
-        if (! empty($this->retirada->getElementsByTagName("CNPJ")->item(0)->nodeValue)) {
1746
+        if (!empty($this->retirada->getElementsByTagName("CNPJ")->item(0)->nodeValue)) {
1747 1747
             $texto = $this->formatField(
1748 1748
                 $this->retirada->getElementsByTagName("CNPJ")->item(0)->nodeValue,
1749 1749
                 "###.###.###/####-##"
1750 1750
             );
1751 1751
         } else {
1752
-            $texto = ! empty($this->retirada->getElementsByTagName("CPF")->item(0)->nodeValue) ?
1752
+            $texto = !empty($this->retirada->getElementsByTagName("CPF")->item(0)->nodeValue) ?
1753 1753
                 $this->formatField(
1754 1754
                     $this->retirada->getElementsByTagName("CPF")->item(0)->nodeValue,
1755 1755
                     "###.###.###-##"
@@ -1758,7 +1758,7 @@  discard block
 block discarded – undo
1758 1758
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1759 1759
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1760 1760
         //INSCRIÇÃO ESTADUAL
1761
-        $x     += $w;
1761
+        $x += $w;
1762 1762
         $w     = $maxW - ($w1 + $w2);
1763 1763
         $wx    = $w;
1764 1764
         $texto = 'INSCRIÇÃO ESTADUAL';
@@ -1777,7 +1777,7 @@  discard block
 block discarded – undo
1777 1777
         //ENDEREÇO
1778 1778
         $w     = round($maxW * 0.355, 0) + $wx;
1779 1779
         $w1    = $w;
1780
-        $y     += $h;
1780
+        $y += $h;
1781 1781
         $x     = $oldX;
1782 1782
         $texto = 'ENDEREÇO';
1783 1783
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
@@ -1788,7 +1788,7 @@  discard block
 block discarded – undo
1788 1788
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1789 1789
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 0, '', true);
1790 1790
         //BAIRRO / DISTRITO
1791
-        $x     += $w;
1791
+        $x += $w;
1792 1792
         $w     = round($maxW * 0.335, 0);
1793 1793
         $w2    = $w;
1794 1794
         $texto = 'BAIRRO / DISTRITO';
@@ -1798,12 +1798,12 @@  discard block
 block discarded – undo
1798 1798
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1799 1799
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1800 1800
         //CEP
1801
-        $x     += $w;
1801
+        $x += $w;
1802 1802
         $w     = $maxW - ($w1 + $w2);
1803 1803
         $texto = 'CEP';
1804 1804
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
1805 1805
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1806
-        $texto = ! empty($this->retirada->getElementsByTagName("CEP")->item(0)->nodeValue) ?
1806
+        $texto = !empty($this->retirada->getElementsByTagName("CEP")->item(0)->nodeValue) ?
1807 1807
             $this->retirada->getElementsByTagName("CEP")->item(0)->nodeValue : '';
1808 1808
         $texto = $this->formatField($texto, "#####-###");
1809 1809
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
@@ -1811,7 +1811,7 @@  discard block
 block discarded – undo
1811 1811
         //MUNICÍPIO
1812 1812
         $w     = round($maxW * 0.805, 0);
1813 1813
         $w1    = $w;
1814
-        $y     += $h;
1814
+        $y += $h;
1815 1815
         $x     = $oldX;
1816 1816
         $texto = 'MUNICÍPIO';
1817 1817
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
@@ -1823,7 +1823,7 @@  discard block
 block discarded – undo
1823 1823
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1824 1824
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 0, '');
1825 1825
         //UF
1826
-        $x     += $w;
1826
+        $x += $w;
1827 1827
         $w     = 8;
1828 1828
         $texto = 'UF';
1829 1829
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
@@ -1832,12 +1832,12 @@  discard block
 block discarded – undo
1832 1832
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1833 1833
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1834 1834
         //FONE / FAX
1835
-        $x     += $w;
1835
+        $x += $w;
1836 1836
         $w     = $maxW - $w - $w1;
1837 1837
         $texto = 'FONE / FAX';
1838 1838
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
1839 1839
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1840
-        $texto = ! empty($this->retirada->getElementsByTagName("fone")->item(0)->nodeValue) ?
1840
+        $texto = !empty($this->retirada->getElementsByTagName("fone")->item(0)->nodeValue) ?
1841 1841
             $this->retirada->getElementsByTagName("fone")->item(0)->nodeValue : '';
1842 1842
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1843 1843
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
@@ -1857,7 +1857,7 @@  discard block
 block discarded – undo
1857 1857
         if (isset($this->cobr)) {
1858 1858
             $fat = $this->cobr->getElementsByTagName("fat")->item(0);
1859 1859
             if (isset($fat)) {
1860
-                if (! empty($this->getTagValue($this->ide, "indPag"))) {
1860
+                if (!empty($this->getTagValue($this->ide, "indPag"))) {
1861 1861
                     $textoIndPag = "";
1862 1862
                     $indPag      = $this->getTagValue($this->ide, "indPag");
1863 1863
                     if ($indPag === "0") {
@@ -1931,7 +1931,7 @@  discard block
 block discarded – undo
1931 1931
             $h     = 8;
1932 1932
             $aFont = ['font' => $this->fontePadrao, 'size' => 7, 'style' => 'B'];
1933 1933
             $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
1934
-            $y       += 3;
1934
+            $y += 3;
1935 1935
             $dups    = "";
1936 1936
             $dupcont = 0;
1937 1937
             $nFat    = $this->dup->length;
@@ -1965,13 +1965,13 @@  discard block
 block discarded – undo
1965 1965
             }
1966 1966
             $increm = 1;
1967 1967
             foreach ($this->dup as $k => $d) {
1968
-                $nDup  = ! empty($this->dup->item($k)->getElementsByTagName('nDup')->item(0)->nodeValue)
1968
+                $nDup  = !empty($this->dup->item($k)->getElementsByTagName('nDup')->item(0)->nodeValue)
1969 1969
                     ? $this->dup->item($k)->getElementsByTagName('nDup')->item(0)->nodeValue
1970 1970
                     : '';
1971
-                $dDup  = ! empty($this->dup->item($k)->getElementsByTagName('dVenc')->item(0)->nodeValue)
1971
+                $dDup  = !empty($this->dup->item($k)->getElementsByTagName('dVenc')->item(0)->nodeValue)
1972 1972
                     ? $this->ymdTodmy($this->dup->item($k)->getElementsByTagName('dVenc')->item(0)->nodeValue)
1973 1973
                     : '';
1974
-                $vDup  = ! empty($this->dup->item($k)->getElementsByTagName('vDup')->item(0)->nodeValue)
1974
+                $vDup  = !empty($this->dup->item($k)->getElementsByTagName('vDup')->item(0)->nodeValue)
1975 1975
                     ? 'R$ ' . number_format(
1976 1976
                         $this->dup->item($k)->getElementsByTagName('vDup')->item(0)->nodeValue,
1977 1977
                         2,
@@ -2018,7 +2018,7 @@  discard block
 block discarded – undo
2018 2018
             }
2019 2019
             if ($dupcont == 0) {
2020 2020
                 $y -= 9;
2021
-                $linha --;
2021
+                $linha--;
2022 2022
             }
2023 2023
 
2024 2024
             return ($y + $h);
@@ -2058,7 +2058,7 @@  discard block
 block discarded – undo
2058 2058
             $h     = 8;
2059 2059
             $aFont = ['font' => $this->fontePadrao, 'size' => 7, 'style' => 'B'];
2060 2060
             $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
2061
-            $y       += 3;
2061
+            $y += 3;
2062 2062
             $dups    = "";
2063 2063
             $dupcont = 0;
2064 2064
             if ($this->orientacao == 'P') {
@@ -2091,7 +2091,7 @@  discard block
 block discarded – undo
2091 2091
                 '90' => 'Sem pagamento',
2092 2092
                 '99' => 'Outros'
2093 2093
             ];
2094
-            $bandeira       = [
2094
+            $bandeira = [
2095 2095
                 '01' => 'Visa',
2096 2096
                 '02' => 'Mastercard',
2097 2097
                 '03' => 'American',
@@ -2104,10 +2104,10 @@  discard block
 block discarded – undo
2104 2104
                 '99' => 'Outros'
2105 2105
             ];
2106 2106
             foreach ($this->detPag as $k => $d) {
2107
-                $fPag  = ! empty($this->detPag->item($k)->getElementsByTagName('tPag')->item(0)->nodeValue)
2107
+                $fPag  = !empty($this->detPag->item($k)->getElementsByTagName('tPag')->item(0)->nodeValue)
2108 2108
                     ? $this->detPag->item($k)->getElementsByTagName('tPag')->item(0)->nodeValue
2109 2109
                     : '0';
2110
-                $vPag  = ! empty($this->detPag->item($k)->getElementsByTagName('vPag')->item(0)->nodeValue)
2110
+                $vPag  = !empty($this->detPag->item($k)->getElementsByTagName('vPag')->item(0)->nodeValue)
2111 2111
                     ? 'R$ ' . number_format(
2112 2112
                         $this->detPag->item($k)->getElementsByTagName('vPag')->item(0)->nodeValue,
2113 2113
                         2,
@@ -2150,7 +2150,7 @@  discard block
 block discarded – undo
2150 2150
             }
2151 2151
             if ($dupcont == 0) {
2152 2152
                 $y -= 9;
2153
-                $linha --;
2153
+                $linha--;
2154 2154
             }
2155 2155
 
2156 2156
             return ($y + $h);
@@ -2182,7 +2182,7 @@  discard block
 block discarded – undo
2182 2182
         $the_field    = $this->ICMSTot->getElementsByTagName($campoImposto)->item(0);
2183 2183
         if (isset($the_field)) {
2184 2184
             $the_value = $the_field->nodeValue;
2185
-            if (! empty($the_value)) {
2185
+            if (!empty($the_value)) {
2186 2186
                 $valorImposto = number_format($the_value, 2, ",", ".");
2187 2187
             }
2188 2188
         }
@@ -2211,10 +2211,10 @@  discard block
 block discarded – undo
2211 2211
         $x_inicial = $x;
2212 2212
         //#####################################################################
2213 2213
         $campos_por_linha = 9;
2214
-        if (! $this->exibirPIS) {
2215
-            $campos_por_linha --;
2214
+        if (!$this->exibirPIS) {
2215
+            $campos_por_linha--;
2216 2216
         }
2217
-        if (! $this->exibirIcmsInterestadual) {
2217
+        if (!$this->exibirIcmsInterestadual) {
2218 2218
             $campos_por_linha -= 2;
2219 2219
         }
2220 2220
 
@@ -2301,12 +2301,12 @@  discard block
 block discarded – undo
2301 2301
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
2302 2302
         //NOME / RAZÃO SOCIAL
2303 2303
         $w1    = $maxW * 0.29;
2304
-        $y     += 3;
2304
+        $y += 3;
2305 2305
         $texto = 'NOME / RAZÃO SOCIAL';
2306 2306
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2307 2307
         $this->pdf->textBox($x, $y, $w1, $h, $texto, $aFont, 'T', 'L', 1, '');
2308 2308
         if (isset($this->transporta)) {
2309
-            $texto = ! empty($this->transporta->getElementsByTagName("xNome")->item(0)->nodeValue)
2309
+            $texto = !empty($this->transporta->getElementsByTagName("xNome")->item(0)->nodeValue)
2310 2310
                 ? $this->transporta->getElementsByTagName("xNome")->item(0)->nodeValue
2311 2311
                 : '';
2312 2312
         } else {
@@ -2315,12 +2315,12 @@  discard block
 block discarded – undo
2315 2315
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
2316 2316
         $this->pdf->textBox($x, $y, $w1, $h, $texto, $aFont, 'B', 'L', 0, '');
2317 2317
         //FRETE POR CONTA
2318
-        $x     += $w1;
2318
+        $x += $w1;
2319 2319
         $w2    = $maxW * 0.15;
2320 2320
         $texto = 'FRETE';
2321 2321
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2322 2322
         $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'T', 'L', 1, '');
2323
-        $tipoFrete = ! empty($this->transp->getElementsByTagName("modFrete")->item(0)->nodeValue)
2323
+        $tipoFrete = !empty($this->transp->getElementsByTagName("modFrete")->item(0)->nodeValue)
2324 2324
             ? $this->transp->getElementsByTagName("modFrete")->item(0)->nodeValue
2325 2325
             : '0';
2326 2326
         switch ($tipoFrete) {
@@ -2346,12 +2346,12 @@  discard block
 block discarded – undo
2346 2346
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
2347 2347
         $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'C', 'C', 1, '');
2348 2348
         //CÓDIGO ANTT
2349
-        $x     += $w2;
2349
+        $x += $w2;
2350 2350
         $texto = 'CÓDIGO ANTT';
2351 2351
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2352 2352
         $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'T', 'L', 1, '');
2353 2353
         if (isset($this->veicTransp)) {
2354
-            $texto = ! empty($this->veicTransp->getElementsByTagName("RNTC")->item(0)->nodeValue)
2354
+            $texto = !empty($this->veicTransp->getElementsByTagName("RNTC")->item(0)->nodeValue)
2355 2355
                 ? $this->veicTransp->getElementsByTagName("RNTC")->item(0)->nodeValue
2356 2356
                 : '';
2357 2357
         } else {
@@ -2360,16 +2360,16 @@  discard block
 block discarded – undo
2360 2360
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
2361 2361
         $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'B', 'C', 0, '');
2362 2362
         //PLACA DO VEÍC
2363
-        $x     += $w2;
2363
+        $x += $w2;
2364 2364
         $texto = 'PLACA DO VEÍCULO';
2365 2365
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2366 2366
         $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'T', 'L', 1, '');
2367 2367
         if (isset($this->veicTransp)) {
2368
-            $texto = ! empty($this->veicTransp->getElementsByTagName("placa")->item(0)->nodeValue)
2368
+            $texto = !empty($this->veicTransp->getElementsByTagName("placa")->item(0)->nodeValue)
2369 2369
                 ? $this->veicTransp->getElementsByTagName("placa")->item(0)->nodeValue
2370 2370
                 : '';
2371 2371
         } elseif (isset($this->reboque)) {
2372
-            $texto = ! empty($this->reboque->getElementsByTagName("placa")->item(0)->nodeValue)
2372
+            $texto = !empty($this->reboque->getElementsByTagName("placa")->item(0)->nodeValue)
2373 2373
                 ? $this->reboque->getElementsByTagName("placa")->item(0)->nodeValue
2374 2374
                 : '';
2375 2375
         } else {
@@ -2378,17 +2378,17 @@  discard block
 block discarded – undo
2378 2378
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
2379 2379
         $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'B', 'C', 0, '');
2380 2380
         //UF
2381
-        $x     += $w2;
2381
+        $x += $w2;
2382 2382
         $w3    = round($maxW * 0.04, 0);
2383 2383
         $texto = 'UF';
2384 2384
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2385 2385
         $this->pdf->textBox($x, $y, $w3, $h, $texto, $aFont, 'T', 'L', 1, '');
2386 2386
         if (isset($this->veicTransp)) {
2387
-            $texto = ! empty($this->veicTransp->getElementsByTagName("UF")->item(0)->nodeValue)
2387
+            $texto = !empty($this->veicTransp->getElementsByTagName("UF")->item(0)->nodeValue)
2388 2388
                 ? $this->veicTransp->getElementsByTagName("UF")->item(0)->nodeValue
2389 2389
                 : '';
2390 2390
         } elseif (isset($this->reboque)) {
2391
-            $texto = ! empty($this->reboque->getElementsByTagName("UF")->item(0)->nodeValue)
2391
+            $texto = !empty($this->reboque->getElementsByTagName("UF")->item(0)->nodeValue)
2392 2392
                 ? $this->reboque->getElementsByTagName("UF")->item(0)->nodeValue
2393 2393
                 : '';
2394 2394
         } else {
@@ -2397,20 +2397,20 @@  discard block
 block discarded – undo
2397 2397
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
2398 2398
         $this->pdf->textBox($x, $y, $w3, $h, $texto, $aFont, 'B', 'C', 0, '');
2399 2399
         //CNPJ / CPF
2400
-        $x     += $w3;
2400
+        $x += $w3;
2401 2401
         $w     = $maxW - ($w1 + 3 * $w2 + $w3);
2402 2402
         $texto = 'CNPJ / CPF';
2403 2403
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2404 2404
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
2405 2405
         if (isset($this->transporta)) {
2406
-            $texto = ! empty($this->transporta->getElementsByTagName("CNPJ")->item(0)->nodeValue)
2406
+            $texto = !empty($this->transporta->getElementsByTagName("CNPJ")->item(0)->nodeValue)
2407 2407
                 ? $this->formatField(
2408 2408
                     $this->transporta->getElementsByTagName("CNPJ")->item(0)->nodeValue,
2409 2409
                     "##.###.###/####-##"
2410 2410
                 )
2411 2411
                 : '';
2412 2412
             if ($texto == '') {
2413
-                $texto = ! empty($this->transporta->getElementsByTagName("CPF")->item(0)->nodeValue)
2413
+                $texto = !empty($this->transporta->getElementsByTagName("CPF")->item(0)->nodeValue)
2414 2414
                     ? $this->formatField(
2415 2415
                         $this->transporta->getElementsByTagName("CPF")->item(0)->nodeValue,
2416 2416
                         "###.###.###-##"
@@ -2424,7 +2424,7 @@  discard block
 block discarded – undo
2424 2424
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
2425 2425
         //#####################################################################
2426 2426
         //ENDEREÇO
2427
-        $y     += $h;
2427
+        $y += $h;
2428 2428
         $x     = $oldX;
2429 2429
         $h     = 7;
2430 2430
         $w1    = $maxW * 0.44;
@@ -2432,7 +2432,7 @@  discard block
 block discarded – undo
2432 2432
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2433 2433
         $this->pdf->textBox($x, $y, $w1, $h, $texto, $aFont, 'T', 'L', 1, '');
2434 2434
         if (isset($this->transporta)) {
2435
-            $texto = ! empty($this->transporta->getElementsByTagName("xEnder")->item(0)->nodeValue)
2435
+            $texto = !empty($this->transporta->getElementsByTagName("xEnder")->item(0)->nodeValue)
2436 2436
                 ? $this->transporta->getElementsByTagName("xEnder")->item(0)->nodeValue
2437 2437
                 : '';
2438 2438
         } else {
@@ -2441,13 +2441,13 @@  discard block
 block discarded – undo
2441 2441
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
2442 2442
         $this->pdf->textBox($x, $y, $w1, $h, $texto, $aFont, 'B', 'L', 0, '');
2443 2443
         //MUNICÍPIO
2444
-        $x     += $w1;
2444
+        $x += $w1;
2445 2445
         $w2    = round($maxW * 0.30, 0);
2446 2446
         $texto = 'MUNICÍPIO';
2447 2447
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2448 2448
         $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'T', 'L', 1, '');
2449 2449
         if (isset($this->transporta)) {
2450
-            $texto = ! empty($this->transporta->getElementsByTagName("xMun")->item(0)->nodeValue)
2450
+            $texto = !empty($this->transporta->getElementsByTagName("xMun")->item(0)->nodeValue)
2451 2451
                 ? $this->transporta->getElementsByTagName("xMun")->item(0)->nodeValue
2452 2452
                 : '';
2453 2453
         } else {
@@ -2456,13 +2456,13 @@  discard block
 block discarded – undo
2456 2456
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
2457 2457
         $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'B', 'C', 0, '');
2458 2458
         //UF
2459
-        $x     += $w2;
2459
+        $x += $w2;
2460 2460
         $w3    = round($maxW * 0.04, 0);
2461 2461
         $texto = 'UF';
2462 2462
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2463 2463
         $this->pdf->textBox($x, $y, $w3, $h, $texto, $aFont, 'T', 'L', 1, '');
2464 2464
         if (isset($this->transporta)) {
2465
-            $texto = ! empty($this->transporta->getElementsByTagName("UF")->item(0)->nodeValue)
2465
+            $texto = !empty($this->transporta->getElementsByTagName("UF")->item(0)->nodeValue)
2466 2466
                 ? $this->transporta->getElementsByTagName("UF")->item(0)->nodeValue
2467 2467
                 : '';
2468 2468
         } else {
@@ -2471,14 +2471,14 @@  discard block
 block discarded – undo
2471 2471
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
2472 2472
         $this->pdf->textBox($x, $y, $w3, $h, $texto, $aFont, 'B', 'C', 0, '');
2473 2473
         //INSCRIÇÃO ESTADUAL
2474
-        $x     += $w3;
2474
+        $x += $w3;
2475 2475
         $w     = $maxW - ($w1 + $w2 + $w3);
2476 2476
         $texto = 'INSCRIÇÃO ESTADUAL';
2477 2477
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2478 2478
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
2479 2479
         $texto = '';
2480 2480
         if (isset($this->transporta)) {
2481
-            if (! empty($this->transporta->getElementsByTagName("IE")->item(0)->nodeValue)) {
2481
+            if (!empty($this->transporta->getElementsByTagName("IE")->item(0)->nodeValue)) {
2482 2482
                 $texto = $this->transporta->getElementsByTagName("IE")->item(0)->nodeValue;
2483 2483
             }
2484 2484
         }
@@ -2494,13 +2494,13 @@  discard block
 block discarded – undo
2494 2494
         $pesoBruto   = 0;
2495 2495
         $pesoLiquido = 0;
2496 2496
         foreach ($volumes as $volume) {
2497
-            $quantidade  += ! empty($volume->getElementsByTagName("qVol")->item(0)->nodeValue) ?
2497
+            $quantidade  += !empty($volume->getElementsByTagName("qVol")->item(0)->nodeValue) ?
2498 2498
                 $volume->getElementsByTagName("qVol")->item(0)->nodeValue : 0;
2499
-            $pesoBruto   += ! empty($volume->getElementsByTagName("pesoB")->item(0)->nodeValue) ?
2499
+            $pesoBruto   += !empty($volume->getElementsByTagName("pesoB")->item(0)->nodeValue) ?
2500 2500
                 $volume->getElementsByTagName("pesoB")->item(0)->nodeValue : 0;
2501
-            $pesoLiquido += ! empty($volume->getElementsByTagName("pesoL")->item(0)->nodeValue) ?
2501
+            $pesoLiquido += !empty($volume->getElementsByTagName("pesoL")->item(0)->nodeValue) ?
2502 2502
                 $volume->getElementsByTagName("pesoL")->item(0)->nodeValue : 0;
2503
-            $texto       = ! empty($this->transp->getElementsByTagName("esp")->item(0)->nodeValue) ?
2503
+            $texto = !empty($this->transp->getElementsByTagName("esp")->item(0)->nodeValue) ?
2504 2504
                 $this->transp->getElementsByTagName("esp")->item(0)->nodeValue : '';
2505 2505
             if ($texto != $especie && $especie != '') {
2506 2506
                 //tem várias especies
@@ -2508,7 +2508,7 @@  discard block
 block discarded – undo
2508 2508
             } else {
2509 2509
                 $especie = $texto;
2510 2510
             }
2511
-            $texto = ! empty($this->transp->getElementsByTagName("marca")->item(0)->nodeValue)
2511
+            $texto = !empty($this->transp->getElementsByTagName("marca")->item(0)->nodeValue)
2512 2512
                 ? $this->transp->getElementsByTagName("marca")->item(0)->nodeValue
2513 2513
                 : '';
2514 2514
             if ($texto != $marca && $marca != '') {
@@ -2517,7 +2517,7 @@  discard block
 block discarded – undo
2517 2517
             } else {
2518 2518
                 $marca = $texto;
2519 2519
             }
2520
-            $texto = ! empty($this->transp->getElementsByTagName("nVol")->item(0)->nodeValue)
2520
+            $texto = !empty($this->transp->getElementsByTagName("nVol")->item(0)->nodeValue)
2521 2521
                 ? $this->transp->getElementsByTagName("nVol")->item(0)->nodeValue
2522 2522
                 : '';
2523 2523
             if ($texto != $numero && $numero != '') {
@@ -2530,20 +2530,20 @@  discard block
 block discarded – undo
2530 2530
 
2531 2531
         //#####################################################################
2532 2532
         //QUANTIDADE
2533
-        $y     += $h;
2533
+        $y += $h;
2534 2534
         $x     = $oldX;
2535 2535
         $h     = 7;
2536 2536
         $w1    = round($maxW * 0.10, 0);
2537 2537
         $texto = 'QUANTIDADE';
2538 2538
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2539 2539
         $this->pdf->textBox($x, $y, $w1, $h, $texto, $aFont, 'T', 'L', 1, '');
2540
-        if (! empty($quantidade)) {
2540
+        if (!empty($quantidade)) {
2541 2541
             $texto = $quantidade;
2542 2542
             $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
2543 2543
             $this->pdf->textBox($x, $y, $w1, $h, $texto, $aFont, 'B', 'C', 0, '');
2544 2544
         }
2545 2545
         //ESPÉCIE
2546
-        $x     += $w1;
2546
+        $x += $w1;
2547 2547
         $w2    = round($maxW * 0.17, 0);
2548 2548
         $texto = 'ESPÉCIE';
2549 2549
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
@@ -2552,16 +2552,16 @@  discard block
 block discarded – undo
2552 2552
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
2553 2553
         $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'B', 'C', 0, '');
2554 2554
         //MARCA
2555
-        $x     += $w2;
2555
+        $x += $w2;
2556 2556
         $texto = 'MARCA';
2557 2557
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2558 2558
         $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'T', 'L', 1, '');
2559
-        $texto = ! empty($this->transp->getElementsByTagName("marca")->item(0)->nodeValue) ?
2559
+        $texto = !empty($this->transp->getElementsByTagName("marca")->item(0)->nodeValue) ?
2560 2560
             $this->transp->getElementsByTagName("marca")->item(0)->nodeValue : '';
2561 2561
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
2562 2562
         $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'B', 'C', 0, '');
2563 2563
         //NUMERAÇÃO
2564
-        $x     += $w2;
2564
+        $x += $w2;
2565 2565
         $texto = 'NUMERAÇÃO';
2566 2566
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2567 2567
         $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'T', 'L', 1, '');
@@ -2569,7 +2569,7 @@  discard block
 block discarded – undo
2569 2569
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
2570 2570
         $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'B', 'C', 0, '');
2571 2571
         //PESO BRUTO
2572
-        $x     += $w2;
2572
+        $x += $w2;
2573 2573
         $w3    = round($maxW * 0.20, 0);
2574 2574
         $texto = 'PESO BRUTO';
2575 2575
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
@@ -2582,7 +2582,7 @@  discard block
 block discarded – undo
2582 2582
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
2583 2583
         $this->pdf->textBox($x, $y, $w3, $h, $texto, $aFont, 'B', 'R', 0, '');
2584 2584
         //PESO LÍQUIDO
2585
-        $x     += $w3;
2585
+        $x += $w3;
2586 2586
         $w     = $maxW - ($w1 + 3 * $w2 + $w3);
2587 2587
         $texto = 'PESO LÍQUIDO';
2588 2588
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
@@ -2602,11 +2602,11 @@  discard block
 block discarded – undo
2602 2602
     protected function descricaoProdutoHelper($origem, $campo, $formato)
2603 2603
     {
2604 2604
         $valor_original = $origem->getElementsByTagName($campo)->item(0);
2605
-        if (! isset($valor_original)) {
2605
+        if (!isset($valor_original)) {
2606 2606
             return "";
2607 2607
         }
2608 2608
         $valor_original = $valor_original->nodeValue;
2609
-        $valor          = ! empty($valor_original) ? number_format($valor_original, 2, ",", ".") : '';
2609
+        $valor          = !empty($valor_original) ? number_format($valor_original, 2, ",", ".") : '';
2610 2610
 
2611 2611
         if ($valor != "") {
2612 2612
             return sprintf($formato, $valor);
@@ -2632,7 +2632,7 @@  discard block
 block discarded – undo
2632 2632
         $ICMSUFDest = $itemProd->getElementsByTagName("ICMSUFDest")->item(0);
2633 2633
         $impostos   = '';
2634 2634
 
2635
-        if (! empty($ICMS)) {
2635
+        if (!empty($ICMS)) {
2636 2636
             $impostos .= $this->descricaoProdutoHelper($ICMS, "vBCFCP", " BcFcp=%s");
2637 2637
             $impostos .= $this->descricaoProdutoHelper($ICMS, "pFCP", " pFcp=%s%%");
2638 2638
             $impostos .= $this->descricaoProdutoHelper($ICMS, "vFCP", " vFcp=%s");
@@ -2648,7 +2648,7 @@  discard block
 block discarded – undo
2648 2648
             $impostos .= $this->descricaoProdutoHelper($ICMS, "pST", " pSt=%s");
2649 2649
             $impostos .= $this->descricaoProdutoHelper($ICMS, "vICMSSTRet", " VALOR ICMS ST=%s");
2650 2650
         }
2651
-        if (! empty($ICMSUFDest)) {
2651
+        if (!empty($ICMSUFDest)) {
2652 2652
             $impostos .= $this->descricaoProdutoHelper($ICMSUFDest, "pFCPUFDest", " pFCPUFDest=%s%%");
2653 2653
             $impostos .= $this->descricaoProdutoHelper($ICMSUFDest, "pICMSUFDest", " pICMSUFDest=%s%%");
2654 2654
             $impostos .= $this->descricaoProdutoHelper($ICMSUFDest, "pICMSInterPart", " pICMSInterPart=%s%%");
@@ -2656,20 +2656,20 @@  discard block
 block discarded – undo
2656 2656
             $impostos .= $this->descricaoProdutoHelper($ICMSUFDest, "vICMSUFDest", " vICMSUFDest=%s");
2657 2657
             $impostos .= $this->descricaoProdutoHelper($ICMSUFDest, "vICMSUFRemet", " vICMSUFRemet=%s");
2658 2658
         }
2659
-        $infAdProd = ! empty($itemProd->getElementsByTagName('infAdProd')->item(0)->nodeValue)
2659
+        $infAdProd = !empty($itemProd->getElementsByTagName('infAdProd')->item(0)->nodeValue)
2660 2660
             ? substr(
2661 2661
                 $this->anfaveaDANFE($itemProd->getElementsByTagName('infAdProd')->item(0)->nodeValue),
2662 2662
                 0,
2663 2663
                 500
2664 2664
             )
2665 2665
             : '';
2666
-        if (! empty($infAdProd)) {
2666
+        if (!empty($infAdProd)) {
2667 2667
             $infAdProd = trim($infAdProd);
2668 2668
             $infAdProd .= ' ';
2669 2669
         }
2670 2670
         $loteTxt = '';
2671 2671
         $rastro  = $prod->getElementsByTagName("med");
2672
-        if (! empty($prod->getElementsByTagName("rastro"))) {
2672
+        if (!empty($prod->getElementsByTagName("rastro"))) {
2673 2673
             $rastro = $prod->getElementsByTagName("rastro");
2674 2674
             $i      = 0;
2675 2675
             while ($i < $rastro->length) {
@@ -2683,14 +2683,14 @@  discard block
 block discarded – undo
2683 2683
                 $loteTxt .= $datafab; //$this->getTagDate($rastro->item($i), 'dFab', ' Fab: ');
2684 2684
                 $loteTxt .= $dataval; //$this->getTagDate($rastro->item($i), 'dVal', ' Val: ');
2685 2685
                 $loteTxt .= $this->getTagValue($rastro->item($i), 'vPMC', ' PMC: ');
2686
-                $i ++;
2686
+                $i++;
2687 2687
             }
2688 2688
             if ($loteTxt != '') {
2689 2689
                 $loteTxt .= ' ';
2690 2690
             }
2691 2691
         }
2692 2692
         //NT2013.006 FCI
2693
-        $nFCI   = (! empty($itemProd->getElementsByTagName('nFCI')->item(0)->nodeValue)) ?
2693
+        $nFCI   = (!empty($itemProd->getElementsByTagName('nFCI')->item(0)->nodeValue)) ?
2694 2694
             ' FCI:' . $itemProd->getElementsByTagName('nFCI')->item(0)->nodeValue : '';
2695 2695
         $tmp_ad = $infAdProd . ($this->descProdInfoComplemento ? $loteTxt . $impostos . $nFCI : '');
2696 2696
         $texto  = $prod->getElementsByTagName("xProd")->item(0)->nodeValue
@@ -2740,7 +2740,7 @@  discard block
 block discarded – undo
2740 2740
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
2741 2741
         $y += 3;
2742 2742
         //desenha a caixa dos dados dos itens da NF
2743
-        $hmax  += 1;
2743
+        $hmax += 1;
2744 2744
         $texto = '';
2745 2745
         $this->pdf->textBox($x, $y, $w, $hmax);
2746 2746
         //##################################################################################
@@ -2753,101 +2753,101 @@  discard block
 block discarded – undo
2753 2753
         $this->pdf->textBox($x, $y, $w1, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2754 2754
         $this->pdf->line($x + $w1, $y, $x + $w1, $y + $hmax);
2755 2755
         //DESCRIÇÃO DO PRODUTO / SERVIÇO
2756
-        $x     += $w1;
2756
+        $x += $w1;
2757 2757
         $w2    = round($w * 0.25, 0);
2758 2758
         $texto = 'DESCRIÇÃO DO PRODUTO / SERVIÇO';
2759 2759
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2760 2760
         $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2761 2761
         $this->pdf->line($x + $w2, $y, $x + $w2, $y + $hmax);
2762 2762
         //NCM/SH
2763
-        $x     += $w2;
2763
+        $x += $w2;
2764 2764
         $w3    = round($w * 0.06, 0);
2765 2765
         $texto = 'NCM/SH';
2766 2766
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2767 2767
         $this->pdf->textBox($x, $y, $w3, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2768 2768
         $this->pdf->line($x + $w3, $y, $x + $w3, $y + $hmax);
2769 2769
         //O/CST ou O/CSOSN
2770
-        $x     += $w3;
2770
+        $x += $w3;
2771 2771
         $w4    = round($w * 0.05, 0);
2772 2772
         $texto = 'O/CST'; // CRT = 2 ou CRT = 3
2773 2773
         if ($this->getTagValue($this->emit, 'CRT') == '1') {
2774
-            $texto = 'O/CSOSN';//Regime do Simples CRT = 1
2774
+            $texto = 'O/CSOSN'; //Regime do Simples CRT = 1
2775 2775
         }
2776 2776
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2777 2777
         $this->pdf->textBox($x, $y, $w4, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2778 2778
         $this->pdf->line($x + $w4, $y, $x + $w4, $y + $hmax);
2779 2779
         //CFOP
2780
-        $x     += $w4;
2780
+        $x += $w4;
2781 2781
         $w5    = round($w * 0.04, 0);
2782 2782
         $texto = 'CFOP';
2783 2783
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2784 2784
         $this->pdf->textBox($x, $y, $w5, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2785 2785
         $this->pdf->line($x + $w5, $y, $x + $w5, $y + $hmax);
2786 2786
         //UN
2787
-        $x     += $w5;
2787
+        $x += $w5;
2788 2788
         $w6    = round($w * 0.03, 0);
2789 2789
         $texto = 'UN';
2790 2790
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2791 2791
         $this->pdf->textBox($x, $y, $w6, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2792 2792
         $this->pdf->line($x + $w6, $y, $x + $w6, $y + $hmax);
2793 2793
         //QUANT
2794
-        $x     += $w6;
2794
+        $x += $w6;
2795 2795
         $w7    = round($w * 0.08, 0);
2796 2796
         $texto = 'QUANT';
2797 2797
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2798 2798
         $this->pdf->textBox($x, $y, $w7, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2799 2799
         $this->pdf->line($x + $w7, $y, $x + $w7, $y + $hmax);
2800 2800
         //VALOR UNIT
2801
-        $x     += $w7;
2801
+        $x += $w7;
2802 2802
         $w8    = round($w * 0.06, 0);
2803 2803
         $texto = 'VALOR UNIT';
2804 2804
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2805 2805
         $this->pdf->textBox($x, $y, $w8, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2806 2806
         $this->pdf->line($x + $w8, $y, $x + $w8, $y + $hmax);
2807 2807
         //VALOR TOTAL
2808
-        $x     += $w8;
2808
+        $x += $w8;
2809 2809
         $w9    = round($w * 0.06, 0);
2810 2810
         $texto = 'VALOR TOTAL';
2811 2811
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2812 2812
         $this->pdf->textBox($x, $y, $w9, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2813 2813
         $this->pdf->line($x + $w9, $y, $x + $w9, $y + $hmax);
2814 2814
         //VALOR DESCONTO
2815
-        $x     += $w9;
2815
+        $x += $w9;
2816 2816
         $w10   = round($w * 0.05, 0);
2817 2817
         $texto = 'VALOR DESC';
2818 2818
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2819 2819
         $this->pdf->textBox($x, $y, $w10, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2820 2820
         $this->pdf->line($x + $w10, $y, $x + $w10, $y + $hmax);
2821 2821
         //B.CÁLC ICMS
2822
-        $x     += $w10;
2822
+        $x += $w10;
2823 2823
         $w11   = round($w * 0.06, 0);
2824 2824
         $texto = 'B.CÁLC ICMS';
2825 2825
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2826 2826
         $this->pdf->textBox($x, $y, $w11, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2827 2827
         $this->pdf->line($x + $w11, $y, $x + $w11, $y + $hmax);
2828 2828
         //VALOR ICMS
2829
-        $x     += $w11;
2829
+        $x += $w11;
2830 2830
         $w12   = round($w * 0.06, 0);
2831 2831
         $texto = 'VALOR ICMS';
2832 2832
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2833 2833
         $this->pdf->textBox($x, $y, $w12, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2834 2834
         $this->pdf->line($x + $w12, $y, $x + $w12, $y + $hmax);
2835 2835
         //VALOR IPI
2836
-        $x     += $w12;
2836
+        $x += $w12;
2837 2837
         $w13   = round($w * 0.05, 0);
2838 2838
         $texto = 'VALOR IPI';
2839 2839
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2840 2840
         $this->pdf->textBox($x, $y, $w13, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2841 2841
         $this->pdf->line($x + $w13, $y, $x + $w13, $y + $hmax);
2842 2842
         //ALÍQ. ICMS
2843
-        $x     += $w13;
2843
+        $x += $w13;
2844 2844
         $w14   = round($w * 0.04, 0);
2845 2845
         $texto = 'ALÍQ. ICMS';
2846 2846
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2847 2847
         $this->pdf->textBox($x, $y, $w14, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2848 2848
         $this->pdf->line($x + $w14, $y, $x + $w14, $y + $hmax);
2849 2849
         //ALÍQ. IPI
2850
-        $x     += $w14;
2850
+        $x += $w14;
2851 2851
         $w15   = $w - ($w1 + $w2 + $w3 + $w4 + $w5 + $w6 + $w7 + $w8 + $w9 + $w10 + $w11 + $w12 + $w13 + $w14);
2852 2852
         $texto = 'ALÍQ. IPI';
2853 2853
         $this->pdf->textBox($x, $y, $w15, $h, $texto, $aFont, 'C', 'C', 0, '', false);
@@ -2901,7 +2901,7 @@  discard block
 block discarded – undo
2901 2901
                 // Informação sobre unidade de medida tributavel.
2902 2902
                 // Se não for para exibir a unidade de medida tributavel, então
2903 2903
                 // A Escrita irá começar em 0.
2904
-                if (! $mostrarUnidadeTributavel) {
2904
+                if (!$mostrarUnidadeTributavel) {
2905 2905
                     $yTrib = 0;
2906 2906
                 }
2907 2907
                 $h = $this->calculeHeight($thisItem, $mostrarUnidadeTributavel);
@@ -2936,7 +2936,7 @@  discard block
 block discarded – undo
2936 2936
                 }
2937 2937
                 $x += $w2;
2938 2938
                 //NCM
2939
-                $texto = ! empty($prod->getElementsByTagName("NCM")->item(0)->nodeValue) ?
2939
+                $texto = !empty($prod->getElementsByTagName("NCM")->item(0)->nodeValue) ?
2940 2940
                     $prod->getElementsByTagName("NCM")->item(0)->nodeValue : '';
2941 2941
                 $this->pdf->textBox($x, $y, $w3, $h, $texto, $aFont, 'T', 'C', 0, '');
2942 2942
                 $x += $w3;
@@ -2949,11 +2949,11 @@  discard block
 block discarded – undo
2949 2949
                     $this->pdf->textBox($x, $y, $w4, $h, $texto, $aFont, 'T', 'C', 0, '');
2950 2950
                 }
2951 2951
                 //CFOP
2952
-                $x     += $w4;
2952
+                $x += $w4;
2953 2953
                 $texto = $prod->getElementsByTagName("CFOP")->item(0)->nodeValue;
2954 2954
                 $this->pdf->textBox($x, $y, $w5, $h, $texto, $aFont, 'T', 'C', 0, '');
2955 2955
                 //Unidade
2956
-                $x     += $w5;
2956
+                $x += $w5;
2957 2957
                 $texto = $uCom;
2958 2958
                 $this->pdf->textBox($x, $y, $w6, $h, $texto, $aFont, 'T', 'C', 0, '');
2959 2959
                 //Unidade de medida tributável
@@ -2975,7 +2975,7 @@  discard block
 block discarded – undo
2975 2975
                 // QTDADE Tributável
2976 2976
                 if ($mostrarUnidadeTributavel) {
2977 2977
                     $qTrib = $prod->getElementsByTagName("qTrib")->item(0);
2978
-                    if (! empty($qTrib)) {
2978
+                    if (!empty($qTrib)) {
2979 2979
                         $texto = number_format($qTrib->nodeValue, $this->qComCasasDec, ",", ".");
2980 2980
                         $this->pdf->textBox($x, $yTrib, $w7, $h, $texto, $aFont, 'T', $alinhamento, 0, '');
2981 2981
                     }
@@ -2988,7 +2988,7 @@  discard block
 block discarded – undo
2988 2988
                 // Valor Unitário Tributável
2989 2989
                 if ($mostrarUnidadeTributavel) {
2990 2990
                     $vUnTrib = $prod->getElementsByTagName("vUnTrib")->item(0);
2991
-                    if (! empty($vUnTrib)) {
2991
+                    if (!empty($vUnTrib)) {
2992 2992
                         $texto = number_format($vUnTrib->nodeValue, $this->vUnComCasasDec, ",", ".");
2993 2993
                         $this->pdf->textBox($x, $yTrib, $w8, $h, $texto, $aFont, 'T', $alinhamento, 0, '');
2994 2994
                     }
@@ -3002,7 +3002,7 @@  discard block
 block discarded – undo
3002 3002
                 $this->pdf->textBox($x, $y, $w9, $h, $texto, $aFont, 'T', $alinhamento, 0, '');
3003 3003
                 $x += $w9;
3004 3004
                 //Valor do Desconto
3005
-                $vdesc = ! empty($prod->getElementsByTagName("vDesc")->item(0)->nodeValue)
3005
+                $vdesc = !empty($prod->getElementsByTagName("vDesc")->item(0)->nodeValue)
3006 3006
                     ? $prod->getElementsByTagName("vDesc")->item(0)->nodeValue : 0;
3007 3007
 
3008 3008
                 $texto = number_format($vdesc, 2, ",", ".");
@@ -3010,7 +3010,7 @@  discard block
 block discarded – undo
3010 3010
                 //Valor da Base de calculo
3011 3011
                 $x += $w10;
3012 3012
                 if (isset($ICMS)) {
3013
-                    $texto = ! empty($ICMS->getElementsByTagName("vBC")->item(0)->nodeValue)
3013
+                    $texto = !empty($ICMS->getElementsByTagName("vBC")->item(0)->nodeValue)
3014 3014
                         ? number_format(
3015 3015
                             $ICMS->getElementsByTagName("vBC")->item(0)->nodeValue,
3016 3016
                             2,
@@ -3023,7 +3023,7 @@  discard block
 block discarded – undo
3023 3023
                 //Valor do ICMS
3024 3024
                 $x += $w11;
3025 3025
                 if (isset($ICMS)) {
3026
-                    $texto = ! empty($ICMS->getElementsByTagName("vICMS")->item(0)->nodeValue)
3026
+                    $texto = !empty($ICMS->getElementsByTagName("vICMS")->item(0)->nodeValue)
3027 3027
                         ? number_format(
3028 3028
                             $ICMS->getElementsByTagName("vICMS")->item(0)->nodeValue,
3029 3029
                             2,
@@ -3036,7 +3036,7 @@  discard block
 block discarded – undo
3036 3036
                 //Valor do IPI
3037 3037
                 $x += $w12;
3038 3038
                 if (isset($IPI)) {
3039
-                    $texto = ! empty($IPI->getElementsByTagName("vIPI")->item(0)->nodeValue)
3039
+                    $texto = !empty($IPI->getElementsByTagName("vIPI")->item(0)->nodeValue)
3040 3040
                         ? number_format(
3041 3041
                             $IPI->getElementsByTagName("vIPI")->item(0)->nodeValue,
3042 3042
                             2,
@@ -3051,7 +3051,7 @@  discard block
 block discarded – undo
3051 3051
                 // %ICMS
3052 3052
                 $x += $w13;
3053 3053
                 if (isset($ICMS)) {
3054
-                    $texto = ! empty($ICMS->getElementsByTagName("pICMS")->item(0)->nodeValue)
3054
+                    $texto = !empty($ICMS->getElementsByTagName("pICMS")->item(0)->nodeValue)
3055 3055
                         ? number_format(
3056 3056
                             $ICMS->getElementsByTagName("pICMS")->item(0)->nodeValue,
3057 3057
                             2,
@@ -3064,7 +3064,7 @@  discard block
 block discarded – undo
3064 3064
                 //%IPI
3065 3065
                 $x += $w14;
3066 3066
                 if (isset($IPI)) {
3067
-                    $texto = ! empty($IPI->getElementsByTagName("pIPI")->item(0)->nodeValue)
3067
+                    $texto = !empty($IPI->getElementsByTagName("pIPI")->item(0)->nodeValue)
3068 3068
                         ? number_format(
3069 3069
                             $IPI->getElementsByTagName("pIPI")->item(0)->nodeValue,
3070 3070
                             2,
@@ -3082,17 +3082,17 @@  discard block
 block discarded – undo
3082 3082
                 $veicProd = $prod->getElementsByTagName("veicProd")->item(0);
3083 3083
                 // Tag somente é gerada para veiculo 0k, e só é permitido um veiculo por NF-e por conta do detran
3084 3084
                 // Verifica se a Tag existe
3085
-                if (! empty($veicProd)) {
3085
+                if (!empty($veicProd)) {
3086 3086
                     $this->dadosItenVeiculoDANFE($oldX, $y, $nInicio, $h, $prod);
3087 3087
                 }
3088 3088
 
3089 3089
 
3090 3090
                 $y += $h;
3091
-                $i ++;
3091
+                $i++;
3092 3092
                 //incrementa o controle dos itens processados.
3093
-                $this->qtdeItensProc ++;
3093
+                $this->qtdeItensProc++;
3094 3094
             } else {
3095
-                $i ++;
3095
+                $i++;
3096 3096
             }
3097 3097
         }
3098 3098
 
@@ -3297,23 +3297,23 @@  discard block
 block discarded – undo
3297 3297
         $aFont = ['font' => $this->fontePadrao, 'size' => 7, 'style' => 'B'];
3298 3298
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
3299 3299
         //INSCRIÇÃO MUNICIPAL
3300
-        $y     += 3;
3300
+        $y += 3;
3301 3301
         $w     = round($this->wPrint * 0.23, 0);
3302 3302
         $texto = 'INSCRIÇÃO MUNICIPAL';
3303 3303
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
3304 3304
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
3305 3305
         //inscrição municipal
3306
-        $texto = ! empty($this->emit->getElementsByTagName("IM")->item(0)->nodeValue) ?
3306
+        $texto = !empty($this->emit->getElementsByTagName("IM")->item(0)->nodeValue) ?
3307 3307
             $this->emit->getElementsByTagName("IM")->item(0)->nodeValue : '';
3308 3308
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
3309 3309
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 0, '');
3310 3310
         //VALOR TOTAL DOS SERVIÇOS
3311
-        $x     += $w;
3311
+        $x += $w;
3312 3312
         $texto = 'VALOR TOTAL DOS SERVIÇOS';
3313 3313
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
3314 3314
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
3315 3315
         if (isset($this->ISSQNtot)) {
3316
-            $texto = ! empty($this->ISSQNtot->getElementsByTagName("vServ")->item(0)->nodeValue) ?
3316
+            $texto = !empty($this->ISSQNtot->getElementsByTagName("vServ")->item(0)->nodeValue) ?
3317 3317
                 $this->ISSQNtot->getElementsByTagName("vServ")->item(0)->nodeValue : '';
3318 3318
             $texto = number_format($texto, 2, ",", ".");
3319 3319
         } else {
@@ -3322,14 +3322,14 @@  discard block
 block discarded – undo
3322 3322
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
3323 3323
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'R', 0, '');
3324 3324
         //BASE DE CÁLCULO DO ISSQN
3325
-        $x     += $w;
3325
+        $x += $w;
3326 3326
         $texto = 'BASE DE CÁLCULO DO ISSQN';
3327 3327
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
3328 3328
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
3329 3329
         if (isset($this->ISSQNtot)) {
3330
-            $texto = ! empty($this->ISSQNtot->getElementsByTagName("vBC")->item(0)->nodeValue) ?
3330
+            $texto = !empty($this->ISSQNtot->getElementsByTagName("vBC")->item(0)->nodeValue) ?
3331 3331
                 $this->ISSQNtot->getElementsByTagName("vBC")->item(0)->nodeValue : '';
3332
-            $texto = ! empty($texto) ? number_format($texto, 2, ",", ".") : '';
3332
+            $texto = !empty($texto) ? number_format($texto, 2, ",", ".") : '';
3333 3333
         } else {
3334 3334
             $texto = '';
3335 3335
         }
@@ -3346,9 +3346,9 @@  discard block
 block discarded – undo
3346 3346
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
3347 3347
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
3348 3348
         if (isset($this->ISSQNtot)) {
3349
-            $texto = ! empty($this->ISSQNtot->getElementsByTagName("vISS")->item(0)->nodeValue) ?
3349
+            $texto = !empty($this->ISSQNtot->getElementsByTagName("vISS")->item(0)->nodeValue) ?
3350 3350
                 $this->ISSQNtot->getElementsByTagName("vISS")->item(0)->nodeValue : '';
3351
-            $texto = ! empty($texto) ? number_format($texto, 2, ",", ".") : '';
3351
+            $texto = !empty($texto) ? number_format($texto, 2, ",", ".") : '';
3352 3352
         } else {
3353 3353
             $texto = '';
3354 3354
         }
@@ -3387,13 +3387,13 @@  discard block
 block discarded – undo
3387 3387
 
3388 3388
         //INFORMAÇÕES COMPLEMENTARES
3389 3389
         $texto = "INFORMAÇÕES COMPLEMENTARES";
3390
-        $y     += 3;
3390
+        $y += 3;
3391 3391
         $w     = $this->wAdic;
3392 3392
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => 'B'];
3393 3393
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
3394 3394
         //o texto com os dados adicionais foi obtido na função montaDANFE
3395 3395
         //e carregado em uma propriedade privada da classe
3396
-        $y     += 1;
3396
+        $y += 1;
3397 3397
         $aFont = ['font' => $this->fontePadrao, 'size' => $this->textadicfontsize * $this->pdf->k, 'style' => ''];
3398 3398
         //$aFont = ['font'=>$this->fontePadrao, 'size'=> 5, 'style'=>''];
3399 3399
         $this->pdf->textBox($x, $y + 2, $w - 2, $h, $this->textoAdic, $aFont, 'T', 'L', 0, '', false);
@@ -3438,7 +3438,7 @@  discard block
 block discarded – undo
3438 3438
                 $texto = "CONTINGÊNCIA SVC-RS\n" . $dhCont . "\n" . $xJust;
3439 3439
                 break;
3440 3440
         }
3441
-        $y     += 2;
3441
+        $y += 2;
3442 3442
         $aFont = ['font' => $this->fontePadrao, 'size' => 7, 'style' => ''];
3443 3443
         $this->pdf->textBox($x, $y, $w - 2, $h, $texto, $aFont, 'T', 'L', 0, '', false);
3444 3444
 
@@ -3493,7 +3493,7 @@  discard block
 block discarded – undo
3493 3493
         $tpNF = $this->ide->getElementsByTagName('tpNF')->item(0)->nodeValue;
3494 3494
         if ($tpNF == '0') {
3495 3495
             //NFe de Entrada
3496
-            $emitente     = '';
3496
+            $emitente = '';
3497 3497
             $emitente     .= $this->dest->getElementsByTagName("xNome")->item(0)->nodeValue . " - ";
3498 3498
             $emitente     .= $this->enderDest->getElementsByTagName("xLgr")->item(0)->nodeValue . ", ";
3499 3499
             $emitente     .= $this->enderDest->getElementsByTagName("nro")->item(0)->nodeValue . " - ";
@@ -3546,10 +3546,10 @@  discard block
 block discarded – undo
3546 3546
             $texto .= "AO LADO";
3547 3547
         }
3548 3548
         $texto .= ". EMISSÃO: ";
3549
-        $dEmi  = ! empty($this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue) ?
3549
+        $dEmi = !empty($this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue) ?
3550 3550
             $this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue : '';
3551 3551
         if ($dEmi == '') {
3552
-            $dEmi  = ! empty($this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue) ?
3552
+            $dEmi  = !empty($this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue) ?
3553 3553
                 $this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue : '';
3554 3554
             $aDemi = explode('T', $dEmi);
3555 3555
             $dEmi  = $aDemi[0];
@@ -3572,12 +3572,12 @@  discard block
 block discarded – undo
3572 3572
             $this->pdf->textBox($x1, $y, $w1, 18, $texto, $aFont, 'C', 'C', 1, '');
3573 3573
             //DATA DE RECEBIMENTO
3574 3574
             $texto = "DATA DE RECEBIMENTO";
3575
-            $y     += $h;
3575
+            $y += $h;
3576 3576
             $w2    = round($this->wPrint * 0.17, 0); //35;
3577 3577
             $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
3578 3578
             $this->pdf->textBox($x, $y, $w2, 8, $texto, $aFont, 'T', 'L', 1, '');
3579 3579
             //IDENTIFICAÇÃO E ASSINATURA DO RECEBEDOR
3580
-            $x     += $w2;
3580
+            $x += $w2;
3581 3581
             $w3    = $w - $w2;
3582 3582
             $texto = "IDENTIFICAÇÃO E ASSINATURA DO RECEBEDOR";
3583 3583
             $this->pdf->textBox($x, $y, $w3, 8, $texto, $aFont, 'T', 'L', 1, '');
@@ -3588,7 +3588,7 @@  discard block
 block discarded – undo
3588 3588
 
3589 3589
             return $y;
3590 3590
         } else {
3591
-            $x --;
3591
+            $x--;
3592 3592
             $x = $this->pdf->textBox90($x, $y, $w - 1, $h, $texto, $aFontSmall, 'C', 'L', 0, '', false);
3593 3593
             //NUMERO DA NOTA FISCAL LOGO NFE
3594 3594
             $w1    = 18;
@@ -3609,7 +3609,7 @@  discard block
 block discarded – undo
3609 3609
             $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
3610 3610
             $this->pdf->textBox90($x, $y, $w2, 8, $texto, $aFont, 'T', 'L', 1, '');
3611 3611
             //IDENTIFICAÇÃO E ASSINATURA DO RECEBEDOR
3612
-            $y     -= $w2;
3612
+            $y -= $w2;
3613 3613
             $w3    = $w - $w2;
3614 3614
             $texto = "IDENTIFICAÇÃO E ASSINATURA DO RECEBEDOR";
3615 3615
             $aFont = ['font' => $this->fontePadrao, 'size' => 5.7, 'style' => ''];
@@ -3630,18 +3630,18 @@  discard block
 block discarded – undo
3630 3630
      */
3631 3631
     protected function geraInformacoesDaTagCompra()
3632 3632
     {
3633
-        if (! $this->gerarInformacoesAutomaticas) {
3633
+        if (!$this->gerarInformacoesAutomaticas) {
3634 3634
             return '';
3635 3635
         }
3636 3636
         $saida = "";
3637 3637
         if (isset($this->compra)) {
3638
-            if (! empty($this->compra->getElementsByTagName("xNEmp")->item(0)->nodeValue)) {
3638
+            if (!empty($this->compra->getElementsByTagName("xNEmp")->item(0)->nodeValue)) {
3639 3639
                 $saida .= " Nota de Empenho: " . $this->compra->getElementsByTagName("xNEmp")->item(0)->nodeValue;
3640 3640
             }
3641
-            if (! empty($this->compra->getElementsByTagName("xPed")->item(0)->nodeValue)) {
3641
+            if (!empty($this->compra->getElementsByTagName("xPed")->item(0)->nodeValue)) {
3642 3642
                 $saida .= " Pedido: " . $this->compra->getElementsByTagName("xPed")->item(0)->nodeValue;
3643 3643
             }
3644
-            if (! empty($this->compra->getElementsByTagName("xCont")->item(0)->nodeValue)) {
3644
+            if (!empty($this->compra->getElementsByTagName("xCont")->item(0)->nodeValue)) {
3645 3645
                 $saida .= " Contrato: " . $this->compra->getElementsByTagName("xCont")->item(0)->nodeValue;
3646 3646
             }
3647 3647
         }
@@ -3672,10 +3672,10 @@  discard block
 block discarded – undo
3672 3672
         if ($icmss > 0) {
3673 3673
             $icmss = 1;
3674 3674
         }
3675
-        $dEmi = ! empty($this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue) ?
3675
+        $dEmi = !empty($this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue) ?
3676 3676
             $this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue : '';
3677 3677
         if ($dEmi == '') {
3678
-            $dEmi  = ! empty($this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue) ?
3678
+            $dEmi  = !empty($this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue) ?
3679 3679
                 $this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue : '';
3680 3680
             $aDemi = explode('T', $dEmi);
3681 3681
             $dEmi  = $aDemi[0];
@@ -3699,7 +3699,7 @@  discard block
 block discarded – undo
3699 3699
      */
3700 3700
     protected function geraInformacoesDasNotasReferenciadas()
3701 3701
     {
3702
-        if (! $this->gerarInformacoesAutomaticas) {
3702
+        if (!$this->gerarInformacoesAutomaticas) {
3703 3703
             return '';
3704 3704
         }
3705 3705
         $formaNfeRef = "\r\nNFe Ref.: série:%d número:%d emit:%s em %s [%s]";
@@ -3727,7 +3727,7 @@  discard block
 block discarded – undo
3727 3727
                 $cnpj          = $this->formatField(substr($chave_acesso, 6, 14), "##.###.###/####-##");
3728 3728
                 $serie         = substr($chave_acesso, 22, 3);
3729 3729
                 $numero        = substr($chave_acesso, 25, 9);
3730
-                $saida         .= sprintf($formaNfeRef, $serie, $numero, $cnpj, $data, $chave_acessoF);
3730
+                $saida .= sprintf($formaNfeRef, $serie, $numero, $cnpj, $data, $chave_acessoF);
3731 3731
             }
3732 3732
             $refNF = $nfRef->getElementsByTagName('refNF');
3733 3733
             foreach ($refNF as $umaRefNFe) {
@@ -3738,7 +3738,7 @@  discard block
 block discarded – undo
3738 3738
                 $numero = $umaRefNFe->getElementsByTagName('nNF')->item(0)->nodeValue;
3739 3739
                 $data   = substr($data, 2, 2) . "/20" . substr($data, 0, 2);
3740 3740
                 $cnpj   = $this->formatField($cnpj, "##.###.###/####-##");
3741
-                $saida  .= sprintf($formaNfRef, $serie, $numero, $cnpj, $data, $mod);
3741
+                $saida .= sprintf($formaNfRef, $serie, $numero, $cnpj, $data, $mod);
3742 3742
             }
3743 3743
             $refCTe = $nfRef->getElementsByTagName('refCTe');
3744 3744
             foreach ($refCTe as $chave_acessoRef) {
@@ -3748,7 +3748,7 @@  discard block
 block discarded – undo
3748 3748
                 $cnpj          = $this->formatField(substr($chave_acesso, 6, 14), "##.###.###/####-##");
3749 3749
                 $serie         = substr($chave_acesso, 22, 3);
3750 3750
                 $numero        = substr($chave_acesso, 25, 9);
3751
-                $saida         .= sprintf($formaCTeRef, $serie, $numero, $cnpj, $data, $chave_acessoF);
3751
+                $saida .= sprintf($formaCTeRef, $serie, $numero, $cnpj, $data, $chave_acessoF);
3752 3752
             }
3753 3753
             $refECF = $nfRef->getElementsByTagName('refECF');
3754 3754
             foreach ($refECF as $umaRefNFe) {
@@ -3760,10 +3760,9 @@  discard block
 block discarded – undo
3760 3760
             $refNFP = $nfRef->getElementsByTagName('refNFP');
3761 3761
             foreach ($refNFP as $umaRefNFe) {
3762 3762
                 $data   = $umaRefNFe->getElementsByTagName('AAMM')->item(0)->nodeValue;
3763
-                $cnpj   = ! empty($umaRefNFe->getElementsByTagName('CNPJ')->item(0)->nodeValue) ?
3764
-                    $umaRefNFe->getElementsByTagName('CNPJ')->item(0)->nodeValue :
3765
-                    '';
3766
-                $cpf    = ! empty($umaRefNFe->getElementsByTagName('CPF')->item(0)->nodeValue) ?
3763
+                $cnpj   = !empty($umaRefNFe->getElementsByTagName('CNPJ')->item(0)->nodeValue) ?
3764
+                    $umaRefNFe->getElementsByTagName('CNPJ')->item(0)->nodeValue : '';
3765
+                $cpf    = !empty($umaRefNFe->getElementsByTagName('CPF')->item(0)->nodeValue) ?
3767 3766
                     $umaRefNFe->getElementsByTagName('CPF')->item(0)->nodeValue : '';
3768 3767
                 $mod    = $umaRefNFe->getElementsByTagName('mod')->item(0)->nodeValue;
3769 3768
                 $serie  = $umaRefNFe->getElementsByTagName('serie')->item(0)->nodeValue;
@@ -3785,7 +3784,7 @@  discard block
 block discarded – undo
3785 3784
     private function loadDoc($xml)
3786 3785
     {
3787 3786
         $this->xml = $xml;
3788
-        if (! empty($xml)) {
3787
+        if (!empty($xml)) {
3789 3788
             $this->dom = new Dom();
3790 3789
             $this->dom->loadXML($this->xml);
3791 3790
             if (empty($this->dom->getElementsByTagName("infNFe")->item(0))) {
@@ -3839,7 +3838,7 @@  discard block
 block discarded – undo
3839 3838
         $numlinhas    = $this->pdf->getNumLines($textoProduto, $w2, $aFont);
3840 3839
 
3841 3840
         if ($mostrarUnidadeTributavel && $numlinhas == 1) {
3842
-            $numlinhas ++;
3841
+            $numlinhas++;
3843 3842
         }
3844 3843
 
3845 3844
         return round(($numlinhas * $this->pdf->fontSize) + ($numlinhas * 0.5), 2);
Please login to merge, or discard this patch.
src/Legacy/FPDF/Fpdf181.php 2 patches
Spacing   +56 added lines, -56 removed lines patch added patch discarded remove patch
@@ -7,64 +7,64 @@  discard block
 block discarded – undo
7 7
     const FPDF_VERSION = '1.81';
8 8
     const FPDF_FONTPATH = 'font/';
9 9
 
10
-    protected $page;               // current page number
11
-    protected $n;                  // current object number
12
-    protected $offsets;            // array of object offsets
13
-    protected $buffer;             // buffer holding in-memory PDF
14
-    protected $pages;              // array containing pages
15
-    protected $state;              // current document state
16
-    protected $compress;           // compression flag
17
-    public $k;                  // scale factor (number of points in user unit)
18
-    protected $defOrientation;     // default orientation
19
-    protected $curOrientation;     // current orientation
20
-    protected $stdPageSizes;       // standard page sizes
21
-    protected $defPageSize;        // default page size
22
-    protected $curPageSize;        // current page size
23
-    protected $curRotation;        // current page rotation
24
-    protected $pageInfo;           // page-related data
10
+    protected $page; // current page number
11
+    protected $n; // current object number
12
+    protected $offsets; // array of object offsets
13
+    protected $buffer; // buffer holding in-memory PDF
14
+    protected $pages; // array containing pages
15
+    protected $state; // current document state
16
+    protected $compress; // compression flag
17
+    public $k; // scale factor (number of points in user unit)
18
+    protected $defOrientation; // default orientation
19
+    protected $curOrientation; // current orientation
20
+    protected $stdPageSizes; // standard page sizes
21
+    protected $defPageSize; // default page size
22
+    protected $curPageSize; // current page size
23
+    protected $curRotation; // current page rotation
24
+    protected $pageInfo; // page-related data
25 25
     protected $wPt;
26
-    protected $hPt;          // dimensions of current page in points
26
+    protected $hPt; // dimensions of current page in points
27 27
     protected $w;
28
-    protected $h;              // dimensions of current page in user unit
29
-    protected $lMargin;            // left margin
30
-    protected $tMargin;            // top margin
31
-    protected $rMargin;            // right margin
32
-    protected $bMargin;            // page break margin
33
-    protected $cMargin;            // cell margin
28
+    protected $h; // dimensions of current page in user unit
29
+    protected $lMargin; // left margin
30
+    protected $tMargin; // top margin
31
+    protected $rMargin; // right margin
32
+    protected $bMargin; // page break margin
33
+    protected $cMargin; // cell margin
34 34
     protected $x;
35
-    protected $y;              // current position in user unit
36
-    protected $lasth;              // height of last printed cell
37
-    protected $lineWidth;          // line width in user unit
38
-    protected $fontpath;           // path containing fonts
39
-    protected $coreFonts;          // array of core font names
40
-    protected $fonts;              // array of used fonts
41
-    protected $fontFiles;          // array of font files
42
-    protected $encodings;          // array of encodings
43
-    protected $cmaps;              // array of ToUnicode CMaps
44
-    protected $fontFamily;         // current font family
45
-    protected $fontStyle;          // current font style
46
-    protected $underline;          // underlining flag
47
-    protected $currentFont;        // current font info
48
-    protected $fontSizePt;         // current font size in points
49
-    public $fontSize;           // current font size in user unit
50
-    protected $drawColor;          // commands for drawing color
51
-    protected $fillColor;          // commands for filling color
52
-    protected $textColor;          // commands for text color
53
-    protected $colorFlag;          // indicates whether fill and text colors are different
54
-    protected $withAlpha;          // indicates whether alpha channel is used
55
-    protected $ws;                 // word spacing
56
-    protected $images;             // array of used images
57
-    protected $pageLinks;          // array of links in pages
58
-    protected $links;              // array of internal links
59
-    protected $autoPageBreak;      // automatic page breaking
60
-    protected $pageBreakTrigger;   // threshold used to trigger page breaks
61
-    protected $inHeader;           // flag set when processing header
62
-    protected $infooter;           // flag set when processing footer
63
-    protected $aliasNbPages;       // alias for total number of pages
64
-    protected $zoomMode;           // zoom display mode
65
-    protected $layoutMode;         // layout display mode
66
-    protected $metadata;           // document properties
67
-    protected $pdfVersion;         // PDF version number
35
+    protected $y; // current position in user unit
36
+    protected $lasth; // height of last printed cell
37
+    protected $lineWidth; // line width in user unit
38
+    protected $fontpath; // path containing fonts
39
+    protected $coreFonts; // array of core font names
40
+    protected $fonts; // array of used fonts
41
+    protected $fontFiles; // array of font files
42
+    protected $encodings; // array of encodings
43
+    protected $cmaps; // array of ToUnicode CMaps
44
+    protected $fontFamily; // current font family
45
+    protected $fontStyle; // current font style
46
+    protected $underline; // underlining flag
47
+    protected $currentFont; // current font info
48
+    protected $fontSizePt; // current font size in points
49
+    public $fontSize; // current font size in user unit
50
+    protected $drawColor; // commands for drawing color
51
+    protected $fillColor; // commands for filling color
52
+    protected $textColor; // commands for text color
53
+    protected $colorFlag; // indicates whether fill and text colors are different
54
+    protected $withAlpha; // indicates whether alpha channel is used
55
+    protected $ws; // word spacing
56
+    protected $images; // array of used images
57
+    protected $pageLinks; // array of links in pages
58
+    protected $links; // array of internal links
59
+    protected $autoPageBreak; // automatic page breaking
60
+    protected $pageBreakTrigger; // threshold used to trigger page breaks
61
+    protected $inHeader; // flag set when processing header
62
+    protected $infooter; // flag set when processing footer
63
+    protected $aliasNbPages; // alias for total number of pages
64
+    protected $zoomMode; // zoom display mode
65
+    protected $layoutMode; // layout display mode
66
+    protected $metadata; // document properties
67
+    protected $pdfVersion; // PDF version number
68 68
 
69 69
     public function __construct($orientation = 'P', $unit = 'mm', $size = 'A4')
70 70
     {
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
         $this->withAlpha = false;
98 98
         $this->ws = 0;
99 99
 
100
-        $this->fontpath = __DIR__. FPDF_FONTPATH;
100
+        $this->fontpath = __DIR__ . FPDF_FONTPATH;
101 101
 
102 102
         // Core fonts
103 103
         $this->coreFonts = [
Please login to merge, or discard this patch.
Doc Comments   +56 added lines patch added patch discarded remove patch
@@ -172,6 +172,9 @@  discard block
 block discarded – undo
172 172
         $this->pdfVersion = '1.3';
173 173
     }
174 174
 
175
+    /**
176
+     * @param integer $right
177
+     */
175 178
     public function setMargins($left, $top, $right = null)
176 179
     {
177 180
         // Set left, top and right margins
@@ -204,6 +207,9 @@  discard block
 block discarded – undo
204 207
         $this->rMargin = $margin;
205 208
     }
206 209
 
210
+    /**
211
+     * @param boolean $auto
212
+     */
207 213
     public function setautoPageBreak($auto, $margin = 0)
208 214
     {
209 215
         // Set auto page break mode and triggering margin
@@ -211,6 +217,10 @@  discard block
 block discarded – undo
211 217
         $this->bMargin = $margin;
212 218
         $this->pageBreakTrigger = $this->h - $margin;
213 219
     }
220
+
221
+    /**
222
+     * @param string $zoom
223
+     */
214 224
     public function setDisplayMode($zoom, $layout = 'default')
215 225
     {
216 226
         // Set display mode in viewer
@@ -226,6 +236,9 @@  discard block
 block discarded – undo
226 236
         }
227 237
     }
228 238
 
239
+    /**
240
+     * @param boolean $compress
241
+     */
229 242
     public function setCompression($compress)
230 243
     {
231 244
         // Set page compression
@@ -272,6 +285,9 @@  discard block
 block discarded – undo
272 285
         $this->aliasNbPages = $alias;
273 286
     }
274 287
 
288
+    /**
289
+     * @param string $msg
290
+     */
275 291
     public function error($msg)
276 292
     {
277 293
         // Fatal error
@@ -382,6 +398,12 @@  discard block
 block discarded – undo
382 398
         // Get current page number
383 399
         return $this->page;
384 400
     }
401
+
402
+    /**
403
+     * @param integer $r
404
+     * @param integer $g
405
+     * @param integer $b
406
+     */
385 407
     public function setdrawColor($r, $g = null, $b = null)
386 408
     {
387 409
         // Set color for all stroking operations
@@ -395,6 +417,11 @@  discard block
 block discarded – undo
395 417
         }
396 418
     }
397 419
 
420
+    /**
421
+     * @param integer $r
422
+     * @param integer $g
423
+     * @param integer $b
424
+     */
398 425
     public function setfillColor($r, $g = null, $b = null)
399 426
     {
400 427
         // Set color for all filling operations
@@ -409,6 +436,11 @@  discard block
 block discarded – undo
409 436
         }
410 437
     }
411 438
 
439
+    /**
440
+     * @param integer $r
441
+     * @param integer $g
442
+     * @param integer $b
443
+     */
412 444
     public function settextColor($r, $g = null, $b = null)
413 445
     {
414 446
         // Set color for text
@@ -478,6 +510,9 @@  discard block
 block discarded – undo
478 510
         );
479 511
     }
480 512
 
513
+    /**
514
+     * @param string $family
515
+     */
481 516
     public function addFont($family, $style = '', $file = '')
482 517
     {
483 518
         // Add a TrueType, OpenType or Type1 font
@@ -594,6 +629,10 @@  discard block
 block discarded – undo
594 629
         $this->links[$link] = [$page, $y];
595 630
     }
596 631
 
632
+    /**
633
+     * @param double $y
634
+     * @param string $link
635
+     */
597 636
     public function link($x, $y, $w, $h, $link)
598 637
     {
599 638
         // Put a link on the page
@@ -606,6 +645,10 @@  discard block
 block discarded – undo
606 645
         ];
607 646
     }
608 647
 
648
+    /**
649
+     * @param double $y
650
+     * @param string $txt
651
+     */
609 652
     public function text($x, $y, $txt)
610 653
     {
611 654
         // output a string
@@ -770,6 +813,9 @@  discard block
 block discarded – undo
770 813
         }
771 814
     }
772 815
 
816
+    /**
817
+     * @param integer $h
818
+     */
773 819
     public function multiCell($w, $h, $txt, $border = 0, $align = 'J', $fill = false)
774 820
     {
775 821
         // output text with automatic or explicit line breaks
@@ -970,6 +1016,9 @@  discard block
 block discarded – undo
970 1016
         }
971 1017
     }
972 1018
 
1019
+    /**
1020
+     * @param string $file
1021
+     */
973 1022
     public function image($file, $x = null, $y = null, $w = 0, $h = 0, $type = '', $link = '')
974 1023
     {
975 1024
         // Put an image on the page
@@ -1214,6 +1263,10 @@  discard block
 block discarded – undo
1214 1263
         }
1215 1264
     }
1216 1265
 
1266
+    /**
1267
+     * @param string $orientation
1268
+     * @param string $size
1269
+     */
1217 1270
     protected function beginPage($orientation, $size, $rotation)
1218 1271
     {
1219 1272
         $this->page++;
@@ -1416,6 +1469,9 @@  discard block
 block discarded – undo
1416 1469
         ];
1417 1470
     }
1418 1471
 
1472
+    /**
1473
+     * @param string $file
1474
+     */
1419 1475
     protected function parsePng($file)
1420 1476
     {
1421 1477
         // Extract info from a PNG file
Please login to merge, or discard this patch.
src/NFe/Danfce.php 3 patches
Doc Comments   -1 removed lines patch added patch discarded remove patch
@@ -279,7 +279,6 @@
 block discarded – undo
279 279
 
280 280
     /**
281 281
      * Carrega os dados do xml na classe
282
-     * @param string $xml
283 282
      *
284 283
      * @throws InvalidArgumentException
285 284
      */
Please login to merge, or discard this patch.
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -13,13 +13,11 @@
 block discarded – undo
13 13
  * @link      http://github.com/nfephp-org/sped-da for the canonical source repository
14 14
  */
15 15
 
16
-use DateTime;
17 16
 use Exception;
18 17
 use InvalidArgumentException;
19 18
 use NFePHP\DA\Legacy\Dom;
20 19
 use NFePHP\DA\Legacy\Pdf;
21 20
 use NFePHP\DA\Common\DaCommon;
22
-use Com\Tecnick\Barcode\Barcode;
23 21
 
24 22
 class Danfce extends DaCommon
25 23
 {
Please login to merge, or discard this patch.
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -28,8 +28,8 @@  discard block
 block discarded – undo
28 28
     protected $descPercent = 0.38;
29 29
     protected $xml; // string XML NFe
30 30
     protected $dom;
31
-    protected $logomarca=''; // path para logomarca em jpg
32
-    protected $formatoChave="#### #### #### #### #### #### #### #### #### #### ####";
31
+    protected $logomarca = ''; // path para logomarca em jpg
32
+    protected $formatoChave = "#### #### #### #### #### #### #### #### #### #### ####";
33 33
     protected $nfeProc;
34 34
     protected $nfe;
35 35
     protected $infNFe;
@@ -222,10 +222,10 @@  discard block
 block discarded – undo
222 222
         //total inicial de paginas
223 223
         $totPag = 1;
224 224
         //largura imprimivel em mm: largura da folha menos as margens esq/direita
225
-        $this->wPrint = $maxW-($margEsq*2);
225
+        $this->wPrint = $maxW - ($margEsq * 2);
226 226
         //comprimento (altura) imprimivel em mm: altura da folha menos as margens
227 227
         //superior e inferior
228
-        $this->hPrint = $maxH-$margSup-$margInf;
228
+        $this->hPrint = $maxH - $margSup - $margInf;
229 229
         // estabelece contagem de paginas
230 230
         $this->pdf->aliasNbPages();
231 231
         $this->pdf->setMargins($margEsq, $margSup); // fixa as margens
@@ -249,7 +249,7 @@  discard block
 block discarded – undo
249 249
         $y = $this->blocoIX($y); //informações complementares e sobre tributos
250 250
         $y = $this->blocoX($y); //creditos
251 251
         
252
-        $ymark = $maxH/4;
252
+        $ymark = $maxH / 4;
253 253
         if ($this->tpAmb == 2) {
254 254
             $this->pdf->setTextColor(120, 120, 120);
255 255
             $texto = "SEM VALOR FISCAL\nEmitida em ambiente de homologacao";
@@ -258,7 +258,7 @@  discard block
 block discarded – undo
258 258
                 $this->margem,
259 259
                 $ymark,
260 260
                 $this->wPrint,
261
-                $maxH/2,
261
+                $maxH / 2,
262 262
                 $texto,
263 263
                 $aFont,
264 264
                 'T',
@@ -275,9 +275,9 @@  discard block
 block discarded – undo
275 275
             $aFont = ['font' => $this->fontePadrao, 'size' => 24, 'style' => 'B'];
276 276
             $this->pdf->textBox(
277 277
                 $this->margem,
278
-                $ymark+4,
278
+                $ymark + 4,
279 279
                 $this->wPrint,
280
-                $maxH/2,
280
+                $maxH / 2,
281 281
                 $texto,
282 282
                 $aFont,
283 283
                 'T',
@@ -289,9 +289,9 @@  discard block
 block discarded – undo
289 289
             $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
290 290
             $this->pdf->textBox(
291 291
                 $this->margem,
292
-                $ymark+14,
292
+                $ymark + 14,
293 293
                 $this->wPrint,
294
-                $maxH/2,
294
+                $maxH / 2,
295 295
                 $this->submessage,
296 296
                 $aFont,
297 297
                 'T',
@@ -319,7 +319,7 @@  discard block
 block discarded – undo
319 319
             $y = $this->blocoVIII($y); //QRCODE
320 320
             $y = $this->blocoIX($y); //informações sobre tributos
321 321
             $y = $this->blocoX($y); //creditos
322
-            $ymark = $maxH/4;
322
+            $ymark = $maxH / 4;
323 323
             if ($this->tpAmb == 2) {
324 324
                 $this->pdf->setTextColor(120, 120, 120);
325 325
                 $texto = "SEM VALOR FISCAL\nEmitida em ambiente de homologacao";
@@ -328,7 +328,7 @@  discard block
 block discarded – undo
328 328
                     $this->margem,
329 329
                     $ymark,
330 330
                     $this->wPrint,
331
-                    $maxH/2,
331
+                    $maxH / 2,
332 332
                     $texto,
333 333
                     $aFont,
334 334
                     'T',
@@ -414,7 +414,7 @@  discard block
 block discarded – undo
414 414
             } elseif (!empty($retEvento = $this->nfeProc->getElementsByTagName('retEvento')->item(0))) {
415 415
                 $infEvento = $retEvento->getElementsByTagName('infEvento')->item(0);
416 416
                 $cStat = $this->getTagValue($infEvento, "cStat");
417
-                $tpEvento= $this->getTagValue($infEvento, "tpEvento");
417
+                $tpEvento = $this->getTagValue($infEvento, "tpEvento");
418 418
                 $dhEvento = date(
419 419
                     "d/m/Y H:i:s",
420 420
                     $this->toTimestamp(
Please login to merge, or discard this patch.
src/NFe/Traits/TraitBlocoI.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -31,13 +31,13 @@  discard block
 block discarded – undo
31 31
             $xImg = $this->margem;
32 32
             $yImg = $this->margem + 1;
33 33
             $logoInfo = getimagesize($this->logomarca);
34
-            $logoWmm = ($logoInfo[0]/72)*25.4;
35
-            $logoHmm = ($logoInfo[1]/72)*25.4;
36
-            $nImgW = $this->wPrint/4;
37
-            $nImgH = round($logoHmm * ($nImgW/$logoWmm), 0);
34
+            $logoWmm = ($logoInfo[0] / 72) * 25.4;
35
+            $logoHmm = ($logoInfo[1] / 72) * 25.4;
36
+            $nImgW = $this->wPrint / 4;
37
+            $nImgH = round($logoHmm * ($nImgW / $logoWmm), 0);
38 38
             if ($nImgH > $maxHimg) {
39 39
                 $nImgH = $maxHimg;
40
-                $nImgW = round($logoWmm * ($nImgH/$logoHmm), 0);
40
+                $nImgW = round($logoWmm * ($nImgH / $logoHmm), 0);
41 41
             }
42 42
             $xRs = ($nImgW) + $this->margem;
43 43
             $wRs = ($this->wPrint - $nImgW);
@@ -52,10 +52,10 @@  discard block
 block discarded – undo
52 52
         $aFont = ['font'=>$this->fontePadrao, 'size' => 8, 'style' => ''];
53 53
         $texto = "{$emitRazao}";
54 54
         $y += $this->pdf->textBox(
55
-            $xRs+2,
55
+            $xRs + 2,
56 56
             $this->margem,
57
-            $wRs-2,
58
-            $this->bloco1H-$this->margem-1,
57
+            $wRs - 2,
58
+            $this->bloco1H - $this->margem - 1,
59 59
             $texto,
60 60
             $aFont,
61 61
             'T',
@@ -68,13 +68,13 @@  discard block
 block discarded – undo
68 68
             $aFont = ['font'=>$this->fontePadrao, 'size' => $this->pdf->fontSizePt, 'style' => ''];
69 69
         }
70 70
         $texto = "CNPJ: {$emitCnpj} IE: {$emitIE}";
71
-        $y += $this->pdf->textBox($xRs+2, $y, $wRs-2, 3, $texto, $aFont, 'T', $alignH, false, '', true);
71
+        $y += $this->pdf->textBox($xRs + 2, $y, $wRs - 2, 3, $texto, $aFont, 'T', $alignH, false, '', true);
72 72
         $texto = $emitLgr . ", " . $emitNro;
73
-        $y += $this->pdf->textBox($xRs+2, $y, $wRs-2, 3, $texto, $aFont, 'T', $alignH, false, '', true);
73
+        $y += $this->pdf->textBox($xRs + 2, $y, $wRs - 2, 3, $texto, $aFont, 'T', $alignH, false, '', true);
74 74
         $texto = $emitBairro;
75
-        $y += $this->pdf->textBox($xRs+2, $y, $wRs-2, 3, $texto, $aFont, 'T', $alignH, false, '', true);
75
+        $y += $this->pdf->textBox($xRs + 2, $y, $wRs - 2, 3, $texto, $aFont, 'T', $alignH, false, '', true);
76 76
         $texto = $emitMun . "-" . $emitUF;
77
-        $y += $this->pdf->textBox($xRs+2, $y, $wRs-2, 3, $texto, $aFont, 'T', $alignH, false, '', true);
77
+        $y += $this->pdf->textBox($xRs + 2, $y, $wRs - 2, 3, $texto, $aFont, 'T', $alignH, false, '', true);
78 78
         $this->pdf->dashedHLine($this->margem, $this->bloco1H, $this->wPrint, 0.1, 30);
79 79
         return $this->bloco1H;
80 80
     }
Please login to merge, or discard this patch.
src/NFe/Traits/TraitBlocoII.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
             $aFont = ['font'=> $this->fontePadrao, 'size' => 7, 'style' => ''];
35 35
             $y1 += $this->pdf->textBox(
36 36
                 $this->margem,
37
-                $y+$y1,
37
+                $y + $y1,
38 38
                 $this->wPrint,
39 39
                 2,
40 40
                 $texto,
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
             $aFont = ['font'=> $this->fontePadrao, 'size' => 10, 'style' => 'B'];
51 51
             $y2 = $this->pdf->textBox(
52 52
                 $this->margem,
53
-                $y+$y1,
53
+                $y + $y1,
54 54
                 $this->wPrint,
55 55
                 4,
56 56
                 $texto,
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
             $aFont = ['font'=> $this->fontePadrao, 'size' => 8, 'style' => 'I'];
67 67
             $this->pdf->textBox(
68 68
                 $this->margem,
69
-                $y+$y1+$y2,
69
+                $y + $y1 + $y2,
70 70
                 $this->wPrint,
71 71
                 3,
72 72
                 $texto,
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
             $aFont = ['font'=> $this->fontePadrao, 'size' => 7, 'style' => ''];
84 84
             $y1 = $this->pdf->textBox(
85 85
                 $this->margem,
86
-                $this->bloco1H-2,
86
+                $this->bloco1H - 2,
87 87
                 $this->wPrint,
88 88
                 $this->bloco2H,
89 89
                 $texto,
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
                 true
96 96
             );
97 97
         }
98
-        $this->pdf->dashedHLine($this->margem, $this->bloco2H+$y, $this->wPrint, 0.1, 30);
98
+        $this->pdf->dashedHLine($this->margem, $this->bloco2H + $y, $this->wPrint, 0.1, 30);
99 99
         return $this->bloco2H + $y;
100 100
     }
101 101
 }
Please login to merge, or discard this patch.
src/NFe/Traits/TraitBlocoVI.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -30,11 +30,11 @@  discard block
 block discarded – undo
30 30
             false
31 31
         );
32 32
         
33
-        $texto =  $this->urlChave;
33
+        $texto = $this->urlChave;
34 34
         $aFont = ['font'=> $this->fontePadrao, 'size' => 7, 'style' => ''];
35 35
         $y2 = $this->pdf->textBox(
36 36
             $this->margem,
37
-            $y+$y1,
37
+            $y + $y1,
38 38
             $this->wPrint,
39 39
             2,
40 40
             $texto,
@@ -46,12 +46,12 @@  discard block
 block discarded – undo
46 46
             false
47 47
         );
48 48
         
49
-        $chave =  str_replace('NFe', '', $this->infNFe->getAttribute("Id"));
49
+        $chave = str_replace('NFe', '', $this->infNFe->getAttribute("Id"));
50 50
         $texto = $this->formatField($chave, $this->formatoChave);
51 51
         $aFont = ['font'=> $this->fontePadrao, 'size' => 7, 'style' => ''];
52 52
         $y3 = $this->pdf->textBox(
53 53
             $this->margem,
54
-            $y+$y1+$y2+1,
54
+            $y + $y1 + $y2 + 1,
55 55
             $this->wPrint,
56 56
             2,
57 57
             $texto,
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
             '',
63 63
             true
64 64
         );
65
-        $this->pdf->dashedHLine($this->margem, $this->bloco6H+$y, $this->wPrint, 0.1, 30);
65
+        $this->pdf->dashedHLine($this->margem, $this->bloco6H + $y, $this->wPrint, 0.1, 30);
66 66
         return $this->bloco6H + $y;
67 67
     }
68 68
 }
Please login to merge, or discard this patch.
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -7,6 +7,9 @@
 block discarded – undo
7 7
  */
8 8
 trait TraitBlocoVI
9 9
 {
10
+    /**
11
+     * @param double $y
12
+     */
10 13
     protected function blocoVI($y)
11 14
     {
12 15
         //$this->bloco6H = 10;
Please login to merge, or discard this patch.
src/NFe/Traits/TraitBlocoVIII.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
         */
20 20
         
21 21
         $maxW = $this->wPrint;
22
-        $w = ($maxW*1)+4;
22
+        $w = ($maxW * 1) + 4;
23 23
         $barcode = new Barcode();
24 24
         $bobj = $barcode->getBarcodeObj(
25 25
             'QRCODE,M',
@@ -33,10 +33,10 @@  discard block
 block discarded – undo
33 33
         $wQr = 50;
34 34
         $hQr = 50;
35 35
         $yQr = ($y);
36
-        $xQr = ($w/2) - ($wQr/2);
36
+        $xQr = ($w / 2) - ($wQr / 2);
37 37
         $pic = 'data://text/plain;base64,' . base64_encode($qrcode);
38 38
         $info = getimagesize($pic);
39 39
         $this->pdf->image($pic, $xQr, $yQr, $wQr, $hQr, 'PNG');
40
-        return $this->bloco8H+$y;
40
+        return $this->bloco8H + $y;
41 41
     }
42 42
 }
Please login to merge, or discard this patch.
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -8,6 +8,9 @@
 block discarded – undo
8 8
  */
9 9
 trait TraitBlocoVIII
10 10
 {
11
+    /**
12
+     * @param integer $y
13
+     */
11 14
     protected function blocoVIII($y)
12 15
     {
13 16
         //$this->bloco8H = 50;
Please login to merge, or discard this patch.