Completed
Pull Request — master (#442)
by Roberto
03:26
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 2 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.
Spacing   +226 added lines, -227 removed lines patch added patch discarded remove patch
@@ -326,39 +326,39 @@  discard block
 block discarded – undo
326 326
     {
327 327
         $this->textoAdic = '';
328 328
         //informações adicionais
329
-        $fontProduto            = [
329
+        $fontProduto = [
330 330
             'font'  => $this->fontePadrao,
331 331
             'size'  => 8,
332 332
             'style' => ''
333 333
         ];
334 334
         $k                      = $this->pdf->k;
335 335
         $this->textadicfontsize = $fontProduto['size'] / $k;
336
-        $this->textoAdic        .= $this->geraInformacoesDasNotasReferenciadas();
336
+        $this->textoAdic .= $this->geraInformacoesDasNotasReferenciadas();
337 337
         if (isset($this->infAdic)) {
338 338
             $i = 0;
339 339
             if ($this->textoAdic != '') {
340 340
                 $this->textoAdic .= ". \n";
341 341
             }
342
-            $this->textoAdic .= ! empty($this->getTagValue($this->infAdic, "infCpl"))
342
+            $this->textoAdic .= !empty($this->getTagValue($this->infAdic, "infCpl"))
343 343
                 ? 'Inf. Contribuinte: ' . $this->anfaveaDANFE($this->getTagValue($this->infAdic, "infCpl"))
344 344
                 : '';
345
-            $infPedido       = $this->geraInformacoesDaTagCompra();
345
+            $infPedido = $this->geraInformacoesDaTagCompra();
346 346
             if ($infPedido != "") {
347 347
                 $this->textoAdic .= $infPedido;
348 348
             }
349 349
             $this->textoAdic .= $this->getTagValue($this->dest, "email", ' Email do Destinatário: ');
350
-            $this->textoAdic .= ! empty($this->getTagValue($this->infAdic, "infAdFisco"))
350
+            $this->textoAdic .= !empty($this->getTagValue($this->infAdic, "infAdFisco"))
351 351
                 ? "\n Inf. fisco: " . $this->getTagValue($this->infAdic, "infAdFisco")
352 352
                 : '';
353
-            $obsCont         = $this->infAdic->getElementsByTagName("obsCont");
353
+            $obsCont = $this->infAdic->getElementsByTagName("obsCont");
354 354
             if (isset($obsCont)) {
355 355
                 foreach ($obsCont as $obs) {
356 356
                     $campo           = $obsCont->item($i)->getAttribute("xCampo");
357
-                    $xTexto          = ! empty($obsCont->item($i)->getElementsByTagName("xTexto")->item(0)->nodeValue)
357
+                    $xTexto          = !empty($obsCont->item($i)->getElementsByTagName("xTexto")->item(0)->nodeValue)
358 358
                         ? $obsCont->item($i)->getElementsByTagName("xTexto")->item(0)->nodeValue
359 359
                         : '';
360 360
                     $this->textoAdic .= "\n" . $campo . ':  ' . trim($xTexto);
361
-                    $i ++;
361
+                    $i++;
362 362
                 }
363 363
             }
364 364
         }
@@ -372,7 +372,7 @@  discard block
 block discarded – undo
372 372
             $flagVTT  = $flagVTT && (strpos(strtolower(trim($this->textoAdic)), 'trib') ||
373 373
                     strpos(strtolower(trim($this->textoAdic)), 'imp'));
374 374
             $vTotTrib = $this->getTagValue($this->ICMSTot, 'vTotTrib');
375
-            if ($vTotTrib != '' && ! $flagVTT) {
375
+            if ($vTotTrib != '' && !$flagVTT) {
376 376
                 $this->textoAdic .= "\n Valor Aproximado dos Tributos : R$ "
377 377
                     . number_format($vTotTrib, 2, ",", ".");
378 378
             }
@@ -383,9 +383,9 @@  discard block
 block discarded – undo
383 383
         $this->textadicfontsize = $this->pdf->fontSize;
384 384
         $hdadosadic             = ceil($numlinhasdados * ($this->textadicfontsize));
385 385
         if ($hdadosadic > 70) {
386
-            for ($f = 8; $f > 3; $f --) {
386
+            for ($f = 8; $f > 3; $f--) {
387 387
                 $this->pdf->setFont($this->fontePadrao, '', $f);
388
-                $fontProduto            = [
388
+                $fontProduto = [
389 389
                     'font'  => $this->fontePadrao,
390 390
                     'size'  => $f,
391 391
                     'style' => ''
@@ -509,9 +509,9 @@  discard block
 block discarded – undo
509 509
         $this->hdadosadic = $this->calculoEspacoVericalDadosAdicionais();
510 510
 
511 511
         //altura disponivel para os campos da DANFE
512
-        $hcabecalho    = 47;//para cabeçalho
513
-        $hdestinatario = 25;//para destinatario
514
-        $hduplicatas   = 12;//para cada grupo de 7 duplicatas
512
+        $hcabecalho    = 47; //para cabeçalho
513
+        $hdestinatario = 25; //para destinatario
514
+        $hduplicatas   = 12; //para cada grupo de 7 duplicatas
515 515
         if (isset($this->entrega)) {
516 516
             $hlocalentrega = 25;
517 517
         } else {
@@ -522,11 +522,11 @@  discard block
 block discarded – undo
522 522
         } else {
523 523
             $hlocalretirada = 0;
524 524
         }
525
-        $himposto    = 18;// para imposto
526
-        $htransporte = 25;// para transporte
527
-        $hissqn      = 11;// para issqn
528
-        $hfooter     = 5;// para rodape
529
-        $hCabecItens = 4;//cabeçalho dos itens
525
+        $himposto    = 18; // para imposto
526
+        $htransporte = 25; // para transporte
527
+        $hissqn      = 11; // para issqn
528
+        $hfooter     = 5; // para rodape
529
+        $hCabecItens = 4; //cabeçalho dos itens
530 530
         $hOCUPADA    = $hcabecalho
531 531
             + $hdestinatario
532 532
             + $hlocalentrega
@@ -549,10 +549,10 @@  discard block
 block discarded – undo
549 549
         $this->sizeExtraTextoFatura());*/
550 550
 
551 551
         if ($this->orientacao == 'P') {
552
-            $hDispo1 -= 24 * $this->qCanhoto;//para canhoto
553
-            $w       = $this->wPrint;
552
+            $hDispo1 -= 24 * $this->qCanhoto; //para canhoto
553
+            $w = $this->wPrint;
554 554
         } else {
555
-            $hcanhoto = $this->hPrint;//para canhoto
555
+            $hcanhoto = $this->hPrint; //para canhoto
556 556
             $w        = $this->wPrint - $this->wCanhoto;
557 557
         }
558 558
         //$hDispo1 += 14;
@@ -587,12 +587,12 @@  discard block
 block discarded – undo
587 587
             );
588 588
             $hUsado += $this->calculeHeight($itemProd, $mostrarUnidadeTributavel);
589 589
             if ($hUsado > $hDispo) {
590
-                $totPag ++;
590
+                $totPag++;
591 591
                 $hDispo = $hDispo2;
592 592
                 $hUsado = $hCabecItens;
593
-                $i --; // decrementa para readicionar o item que não coube nessa pagina na outra.
593
+                $i--; // decrementa para readicionar o item que não coube nessa pagina na outra.
594 594
             }
595
-            $i ++;
595
+            $i++;
596 596
         } //fim da soma das areas de itens usadas
597 597
         $qtdeItens = $i; //controle da quantidade de itens no DANFE
598 598
         //montagem da primeira página
@@ -624,7 +624,7 @@  discard block
 block discarded – undo
624 624
         $formaPag = [];
625 625
         if (isset($this->detPag) && $this->detPag->length > 0) {
626 626
             foreach ($this->detPag as $k => $d) {
627
-                $fPag            = ! empty($this->detPag->item($k)->getElementsByTagName('tPag')->item(0)->nodeValue)
627
+                $fPag            = !empty($this->detPag->item($k)->getElementsByTagName('tPag')->item(0)->nodeValue)
628 628
                     ? $this->detPag->item($k)->getElementsByTagName('tPag')->item(0)->nodeValue
629 629
                     : '0';
630 630
                 $formaPag[$fPag] = $fPag;
@@ -668,7 +668,7 @@  discard block
 block discarded – undo
668 668
         }
669 669
 
670 670
         //loop para páginas seguintes
671
-        for ($n = 2; $n <= $totPag; $n ++) {
671
+        for ($n = 2; $n <= $totPag; $n++) {
672 672
             // fixa as margens
673 673
             $this->pdf->setMargins($this->margesq, $this->margsup);
674 674
             //adiciona nova página
@@ -692,7 +692,7 @@  discard block
 block discarded – undo
692 692
             }
693 693
             //se estiver na última página e ainda restar itens para inserir, adiciona mais uma página
694 694
             if ($n == $totPag && $this->qtdeItensProc < $qtdeItens) {
695
-                $totPag ++;
695
+                $totPag++;
696 696
             }
697 697
         }
698 698
     }
@@ -721,7 +721,7 @@  discard block
 block discarded – undo
721 721
         if ($startPos === false) {
722 722
             return $cdata;
723 723
         }
724
-        for ($x = $len; $x > 0; $x --) {
724
+        for ($x = $len; $x > 0; $x--) {
725 725
             if (substr($cdata, $x, 1) == '>') {
726 726
                 $endPos = $x;
727 727
                 break;
@@ -817,15 +817,15 @@  discard block
 block discarded – undo
817 817
         //grupo CADATA infCpl
818 818
         $t          = $dom->getElementsByTagName('transmissor')->item(0);
819 819
         $r          = $dom->getElementsByTagName('receptor')->item(0);
820
-        $versao     = ! empty($dom->getElementsByTagName('versao')->item(0)->nodeValue) ?
820
+        $versao     = !empty($dom->getElementsByTagName('versao')->item(0)->nodeValue) ?
821 821
             'Versao:' . $dom->getElementsByTagName('versao')->item(0)->nodeValue . ' ' : '';
822
-        $especieNF  = ! empty($dom->getElementsByTagName('especieNF')->item(0)->nodeValue) ?
822
+        $especieNF  = !empty($dom->getElementsByTagName('especieNF')->item(0)->nodeValue) ?
823 823
             'Especie:' . $dom->getElementsByTagName('especieNF')->item(0)->nodeValue . ' ' : '';
824
-        $fabEntrega = ! empty($dom->getElementsByTagName('fabEntrega')->item(0)->nodeValue) ?
824
+        $fabEntrega = !empty($dom->getElementsByTagName('fabEntrega')->item(0)->nodeValue) ?
825 825
             'Entrega:' . $dom->getElementsByTagName('fabEntrega')->item(0)->nodeValue . ' ' : '';
826
-        $dca        = ! empty($dom->getElementsByTagName('dca')->item(0)->nodeValue) ?
826
+        $dca        = !empty($dom->getElementsByTagName('dca')->item(0)->nodeValue) ?
827 827
             'dca:' . $dom->getElementsByTagName('dca')->item(0)->nodeValue . ' ' : '';
828
-        $texto      .= "" . $versao . $especieNF . $fabEntrega . $dca;
828
+        $texto .= "" . $versao . $especieNF . $fabEntrega . $dca;
829 829
         if (isset($t)) {
830 830
             if ($t->hasAttributes()) {
831 831
                 $texto .= " Transmissor ";
@@ -871,7 +871,7 @@  discard block
 block discarded – undo
871 871
         } else {
872 872
             if ($this->getTagValue($this->ide, "tpAmb") == '2') {
873 873
                 $resp['status'] = false;
874
-                $resp['message'][] =  "NFe EMITIDA EM HOMOLOGAÇÃO";
874
+                $resp['message'][] = "NFe EMITIDA EM HOMOLOGAÇÃO";
875 875
             }
876 876
             $retEvento = $this->nfeProc->getElementsByTagName('retEvento')->item(0);
877 877
             $cStat = $this->getTagValue($this->nfeProc, "cStat");
@@ -892,7 +892,7 @@  discard block
 block discarded – undo
892 892
             } elseif (!empty($retEvento)) {
893 893
                 $infEvento = $retEvento->getElementsByTagName('infEvento')->item(0);
894 894
                 $cStat = $this->getTagValue($infEvento, "cStat");
895
-                $tpEvento= $this->getTagValue($infEvento, "tpEvento");
895
+                $tpEvento = $this->getTagValue($infEvento, "tpEvento");
896 896
                 $dhEvento = date("d/m/Y H:i:s", $this->toTimestamp($this->getTagValue($infEvento, "dhRegEvento")));
897 897
                 $nProt = $this->getTagValue($infEvento, "nProt");
898 898
                 if ($tpEvento == '110111' &&
@@ -956,7 +956,7 @@  discard block
 block discarded – undo
956 956
         //se for right separa 2/3 para os dados e o terço seguinte para o logo
957 957
         //se não houver logo centraliza dos dados do emitente
958 958
         // coloca o logo
959
-        if (! empty($this->logomarca)) {
959
+        if (!empty($this->logomarca)) {
960 960
             $logoInfo = getimagesize($this->logomarca);
961 961
             //largura da imagem em mm
962 962
             $logoWmm = ($logoInfo[0] / 72) * 25.4;
@@ -1012,7 +1012,7 @@  discard block
 block discarded – undo
1012 1012
             //endereço
1013 1013
             $y1     = $y1 + 5;
1014 1014
             $aFont  = ['font' => $this->fontePadrao, 'size' => 8, 'style' => ''];
1015
-            $fone   = ! empty($this->enderEmit->getElementsByTagName("fone")->item(0)->nodeValue)
1015
+            $fone   = !empty($this->enderEmit->getElementsByTagName("fone")->item(0)->nodeValue)
1016 1016
                 ? $this->enderEmit->getElementsByTagName("fone")->item(0)->nodeValue
1017 1017
                 : '';
1018 1018
             $lgr    = $this->getTagValue($this->enderEmit, "xLgr");
@@ -1031,8 +1031,8 @@  discard block
 block discarded – undo
1031 1031
 
1032 1032
         //####################################################################################
1033 1033
         //coluna central Danfe
1034
-        $x  += $w;
1035
-        $w  = round($maxW * 0.17, 0);//35;
1034
+        $x += $w;
1035
+        $w  = round($maxW * 0.17, 0); //35;
1036 1036
         $w2 = $w;
1037 1037
         $h  = 32;
1038 1038
         $this->pdf->textBox($x, $y, $w, $h);
@@ -1089,8 +1089,8 @@  discard block
 block discarded – undo
1089 1089
 
1090 1090
         //####################################################################################
1091 1091
         //coluna codigo de barras
1092
-        $x  += $w;
1093
-        $w  = ($maxW - $w1 - $w2);//85;
1092
+        $x += $w;
1093
+        $w  = ($maxW - $w1 - $w2); //85;
1094 1094
         $w3 = $w;
1095 1095
         $h  = 32;
1096 1096
         $this->pdf->textBox($x, $y, $w, $h);
@@ -1152,7 +1152,7 @@  discard block
 block discarded – undo
1152 1152
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
1153 1153
         $w     = $w1 + $w2;
1154 1154
         $y     = $oldY;
1155
-        $oldY  += $h;
1155
+        $oldY += $h;
1156 1156
         $x     = $oldX;
1157 1157
         $h     = 7;
1158 1158
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
@@ -1183,7 +1183,7 @@  discard block
 block discarded – undo
1183 1183
                 $cStat = '';
1184 1184
             } else {
1185 1185
                 if (isset($this->nfeProc)) {
1186
-                    $texto  = ! empty($this->nfeProc->getElementsByTagName("nProt")->item(0)->nodeValue)
1186
+                    $texto  = !empty($this->nfeProc->getElementsByTagName("nProt")->item(0)->nodeValue)
1187 1187
                         ? $this->nfeProc->getElementsByTagName("nProt")->item(0)->nodeValue
1188 1188
                         : '';
1189 1189
                     $tsHora = $this->toTimestamp(
@@ -1213,7 +1213,7 @@  discard block
 block discarded – undo
1213 1213
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1214 1214
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1215 1215
         //INSCRIÇÃO MUNICIPAL
1216
-        $x     += $w;
1216
+        $x += $w;
1217 1217
         $texto = 'INSCRIÇÃO MUNICIPAL';
1218 1218
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
1219 1219
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
@@ -1221,29 +1221,29 @@  discard block
 block discarded – undo
1221 1221
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1222 1222
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1223 1223
         //INSCRIÇÃO ESTADUAL DO SUBST. TRIBUT.
1224
-        $x     += $w;
1224
+        $x += $w;
1225 1225
         $texto = 'INSCRIÇÃO ESTADUAL DO SUBST. TRIBUT.';
1226 1226
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
1227 1227
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1228
-        $texto = ! empty($this->emit->getElementsByTagName("IEST")->item(0)->nodeValue)
1228
+        $texto = !empty($this->emit->getElementsByTagName("IEST")->item(0)->nodeValue)
1229 1229
             ? $this->emit->getElementsByTagName("IEST")->item(0)->nodeValue
1230 1230
             : '';
1231 1231
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1232 1232
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1233 1233
         //CNPJ
1234
-        $x     += $w;
1234
+        $x += $w;
1235 1235
         $w     = ($maxW - (3 * $w));
1236 1236
         $texto = 'CNPJ';
1237 1237
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
1238 1238
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1239 1239
         //Pegando valor do CPF/CNPJ
1240
-        if (! empty($this->emit->getElementsByTagName("CNPJ")->item(0)->nodeValue)) {
1240
+        if (!empty($this->emit->getElementsByTagName("CNPJ")->item(0)->nodeValue)) {
1241 1241
             $texto = $this->formatField(
1242 1242
                 $this->emit->getElementsByTagName("CNPJ")->item(0)->nodeValue,
1243 1243
                 "###.###.###/####-##"
1244 1244
             );
1245 1245
         } else {
1246
-            $texto = ! empty($this->emit->getElementsByTagName("CPF")->item(0)->nodeValue)
1246
+            $texto = !empty($this->emit->getElementsByTagName("CPF")->item(0)->nodeValue)
1247 1247
                 ? $this->formatField(
1248 1248
                     $this->emit->getElementsByTagName("CPF")->item(0)->nodeValue,
1249 1249
                     "###.###.###-##"
@@ -1262,7 +1262,7 @@  discard block
 block discarded – undo
1262 1262
             $n = count($resp['message']);
1263 1263
             $alttot = $n * 15;
1264 1264
             $x = 10;
1265
-            $y = $this->hPrint/2 - $alttot/2;
1265
+            $y = $this->hPrint / 2 - $alttot / 2;
1266 1266
             $h = 15;
1267 1267
             $w = $maxW - (2 * $x);
1268 1268
             $this->pdf->settextcolor(90, 90, 90);
@@ -1335,7 +1335,7 @@  discard block
 block discarded – undo
1335 1335
         //NOME / RAZÃO SOCIAL
1336 1336
         $w     = round($maxW * 0.61, 0);
1337 1337
         $w1    = $w;
1338
-        $y     += 3;
1338
+        $y += 3;
1339 1339
         $texto = 'NOME / RAZÃO SOCIAL';
1340 1340
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
1341 1341
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
@@ -1347,20 +1347,20 @@  discard block
 block discarded – undo
1347 1347
             $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 1, '');
1348 1348
         }
1349 1349
         //CNPJ / CPF
1350
-        $x     += $w;
1350
+        $x += $w;
1351 1351
         $w     = round($maxW * 0.23, 0);
1352 1352
         $w2    = $w;
1353 1353
         $texto = 'CNPJ / CPF';
1354 1354
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
1355 1355
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1356 1356
         //Pegando valor do CPF/CNPJ
1357
-        if (! empty($this->dest->getElementsByTagName("CNPJ")->item(0)->nodeValue)) {
1357
+        if (!empty($this->dest->getElementsByTagName("CNPJ")->item(0)->nodeValue)) {
1358 1358
             $texto = $this->formatField(
1359 1359
                 $this->dest->getElementsByTagName("CNPJ")->item(0)->nodeValue,
1360 1360
                 "###.###.###/####-##"
1361 1361
             );
1362 1362
         } else {
1363
-            $texto = ! empty($this->dest->getElementsByTagName("CPF")->item(0)->nodeValue)
1363
+            $texto = !empty($this->dest->getElementsByTagName("CPF")->item(0)->nodeValue)
1364 1364
                 ? $this->formatField(
1365 1365
                     $this->dest->getElementsByTagName("CPF")->item(0)->nodeValue,
1366 1366
                     "###.###.###-##"
@@ -1370,17 +1370,17 @@  discard block
 block discarded – undo
1370 1370
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1371 1371
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1372 1372
         //DATA DA EMISSÃO
1373
-        $x     += $w;
1373
+        $x += $w;
1374 1374
         $w     = $maxW - ($w1 + $w2);
1375 1375
         $wx    = $w;
1376 1376
         $texto = 'DATA DA EMISSÃO';
1377 1377
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
1378 1378
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1379
-        $dEmi = ! empty($this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue)
1379
+        $dEmi = !empty($this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue)
1380 1380
             ? $this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue
1381 1381
             : '';
1382 1382
         if ($dEmi == '') {
1383
-            $dEmi  = ! empty($this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue)
1383
+            $dEmi  = !empty($this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue)
1384 1384
                 ? $this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue
1385 1385
                 : '';
1386 1386
             $aDemi = explode('T', $dEmi);
@@ -1396,7 +1396,7 @@  discard block
 block discarded – undo
1396 1396
         //ENDEREÇO
1397 1397
         $w     = round($maxW * 0.47, 0);
1398 1398
         $w1    = $w;
1399
-        $y     += $h;
1399
+        $y += $h;
1400 1400
         $x     = $oldX;
1401 1401
         $texto = 'ENDEREÇO';
1402 1402
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
@@ -1408,7 +1408,7 @@  discard block
 block discarded – undo
1408 1408
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1409 1409
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 0, '', true);
1410 1410
         //BAIRRO / DISTRITO
1411
-        $x     += $w;
1411
+        $x += $w;
1412 1412
         $w     = round($maxW * 0.21, 0);
1413 1413
         $w2    = $w;
1414 1414
         $texto = 'BAIRRO / DISTRITO';
@@ -1418,29 +1418,29 @@  discard block
 block discarded – undo
1418 1418
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1419 1419
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1420 1420
         //CEP
1421
-        $x     += $w;
1421
+        $x += $w;
1422 1422
         $w     = $maxW - $w1 - $w2 - $wx;
1423 1423
         $w2    = $w;
1424 1424
         $texto = 'CEP';
1425 1425
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
1426 1426
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1427
-        $texto = ! empty($this->dest->getElementsByTagName("CEP")->item(0)->nodeValue)
1427
+        $texto = !empty($this->dest->getElementsByTagName("CEP")->item(0)->nodeValue)
1428 1428
             ? $this->dest->getElementsByTagName("CEP")->item(0)->nodeValue
1429 1429
             : '';
1430 1430
         $texto = $this->formatField($texto, "#####-###");
1431 1431
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1432 1432
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1433 1433
         //DATA DA SAÍDA
1434
-        $x     += $w;
1434
+        $x += $w;
1435 1435
         $w     = $wx;
1436 1436
         $texto = 'DATA DA SAÍDA/ENTRADA';
1437 1437
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
1438 1438
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1439
-        $dSaiEnt = ! empty($this->ide->getElementsByTagName("dSaiEnt")->item(0)->nodeValue)
1439
+        $dSaiEnt = !empty($this->ide->getElementsByTagName("dSaiEnt")->item(0)->nodeValue)
1440 1440
             ? $this->ide->getElementsByTagName("dSaiEnt")->item(0)->nodeValue
1441 1441
             : '';
1442 1442
         if ($dSaiEnt == '') {
1443
-            $dSaiEnt  = ! empty($this->ide->getElementsByTagName("dhSaiEnt")->item(0)->nodeValue)
1443
+            $dSaiEnt  = !empty($this->ide->getElementsByTagName("dhSaiEnt")->item(0)->nodeValue)
1444 1444
                 ? $this->ide->getElementsByTagName("dhSaiEnt")->item(0)->nodeValue
1445 1445
                 : '';
1446 1446
             $aDsaient = explode('T', $dSaiEnt);
@@ -1451,7 +1451,7 @@  discard block
 block discarded – undo
1451 1451
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1452 1452
         //MUNICÍPIO
1453 1453
         $w     = $w1;
1454
-        $y     += $h;
1454
+        $y += $h;
1455 1455
         $x     = $oldX;
1456 1456
         $texto = 'MUNICÍPIO';
1457 1457
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
@@ -1465,7 +1465,7 @@  discard block
 block discarded – undo
1465 1465
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1466 1466
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 0, '');
1467 1467
         //UF
1468
-        $x     += $w;
1468
+        $x += $w;
1469 1469
         $w     = 8;
1470 1470
         $texto = 'UF';
1471 1471
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
@@ -1474,19 +1474,19 @@  discard block
 block discarded – undo
1474 1474
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1475 1475
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1476 1476
         //FONE / FAX
1477
-        $x     += $w;
1477
+        $x += $w;
1478 1478
         $w     = round(($maxW - $w1 - $wx - 8) / 2, 0);
1479 1479
         $w3    = $w;
1480 1480
         $texto = 'FONE / FAX';
1481 1481
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
1482 1482
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1483
-        $texto = ! empty($this->dest->getElementsByTagName("fone")->item(0)->nodeValue)
1483
+        $texto = !empty($this->dest->getElementsByTagName("fone")->item(0)->nodeValue)
1484 1484
             ? $this->dest->getElementsByTagName("fone")->item(0)->nodeValue
1485 1485
             : '';
1486 1486
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1487 1487
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1488 1488
         //INSCRIÇÃO ESTADUAL
1489
-        $x     += $w;
1489
+        $x += $w;
1490 1490
         $w     = $maxW - $w1 - $wx - 8 - $w3;
1491 1491
         $texto = 'INSCRIÇÃO ESTADUAL';
1492 1492
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
@@ -1496,16 +1496,16 @@  discard block
 block discarded – undo
1496 1496
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1497 1497
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1498 1498
         //HORA DA SAÍDA
1499
-        $x     += $w;
1499
+        $x += $w;
1500 1500
         $w     = $wx;
1501 1501
         $texto = 'HORA DA SAÍDA/ENTRADA';
1502 1502
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
1503 1503
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1504
-        $hSaiEnt = ! empty($this->ide->getElementsByTagName("hSaiEnt")->item(0)->nodeValue)
1504
+        $hSaiEnt = !empty($this->ide->getElementsByTagName("hSaiEnt")->item(0)->nodeValue)
1505 1505
             ? $this->ide->getElementsByTagName("hSaiEnt")->item(0)->nodeValue
1506 1506
             : '';
1507 1507
         if ($hSaiEnt == '') {
1508
-            $dhSaiEnt   = ! empty($this->ide->getElementsByTagName("dhSaiEnt")->item(0)->nodeValue)
1508
+            $dhSaiEnt   = !empty($this->ide->getElementsByTagName("dhSaiEnt")->item(0)->nodeValue)
1509 1509
                 ? $this->ide->getElementsByTagName("dhSaiEnt")->item(0)->nodeValue
1510 1510
                 : '';
1511 1511
             $tsDhSaiEnt = $this->toTimestamp($dhSaiEnt);
@@ -1549,7 +1549,7 @@  discard block
 block discarded – undo
1549 1549
         //NOME / RAZÃO SOCIAL
1550 1550
         $w     = round($maxW * 0.61, 0);
1551 1551
         $w1    = $w;
1552
-        $y     += 3;
1552
+        $y += 3;
1553 1553
         $texto = 'NOME / RAZÃO SOCIAL';
1554 1554
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
1555 1555
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
@@ -1564,20 +1564,20 @@  discard block
 block discarded – undo
1564 1564
             $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 1, '');
1565 1565
         }
1566 1566
         //CNPJ / CPF
1567
-        $x     += $w;
1567
+        $x += $w;
1568 1568
         $w     = round($maxW * 0.23, 0);
1569 1569
         $w2    = $w;
1570 1570
         $texto = 'CNPJ / CPF';
1571 1571
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
1572 1572
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1573 1573
         //Pegando valor do CPF/CNPJ
1574
-        if (! empty($this->entrega->getElementsByTagName("CNPJ")->item(0)->nodeValue)) {
1574
+        if (!empty($this->entrega->getElementsByTagName("CNPJ")->item(0)->nodeValue)) {
1575 1575
             $texto = $this->formatField(
1576 1576
                 $this->entrega->getElementsByTagName("CNPJ")->item(0)->nodeValue,
1577 1577
                 "###.###.###/####-##"
1578 1578
             );
1579 1579
         } else {
1580
-            $texto = ! empty($this->entrega->getElementsByTagName("CPF")->item(0)->nodeValue) ?
1580
+            $texto = !empty($this->entrega->getElementsByTagName("CPF")->item(0)->nodeValue) ?
1581 1581
                 $this->formatField(
1582 1582
                     $this->entrega->getElementsByTagName("CPF")->item(0)->nodeValue,
1583 1583
                     "###.###.###-##"
@@ -1586,7 +1586,7 @@  discard block
 block discarded – undo
1586 1586
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1587 1587
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1588 1588
         //INSCRIÇÃO ESTADUAL
1589
-        $x     += $w;
1589
+        $x += $w;
1590 1590
         $w     = $maxW - ($w1 + $w2);
1591 1591
         $wx    = $w;
1592 1592
         $texto = 'INSCRIÇÃO ESTADUAL';
@@ -1605,7 +1605,7 @@  discard block
 block discarded – undo
1605 1605
         //ENDEREÇO
1606 1606
         $w     = round($maxW * 0.355, 0) + $wx;
1607 1607
         $w1    = $w;
1608
-        $y     += $h;
1608
+        $y += $h;
1609 1609
         $x     = $oldX;
1610 1610
         $texto = 'ENDEREÇO';
1611 1611
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
@@ -1616,7 +1616,7 @@  discard block
 block discarded – undo
1616 1616
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1617 1617
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 0, '', true);
1618 1618
         //BAIRRO / DISTRITO
1619
-        $x     += $w;
1619
+        $x += $w;
1620 1620
         $w     = round($maxW * 0.335, 0);
1621 1621
         $w2    = $w;
1622 1622
         $texto = 'BAIRRO / DISTRITO';
@@ -1626,12 +1626,12 @@  discard block
 block discarded – undo
1626 1626
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1627 1627
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1628 1628
         //CEP
1629
-        $x     += $w;
1629
+        $x += $w;
1630 1630
         $w     = $maxW - ($w1 + $w2);
1631 1631
         $texto = 'CEP';
1632 1632
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
1633 1633
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1634
-        $texto = ! empty($this->entrega->getElementsByTagName("CEP")->item(0)->nodeValue) ?
1634
+        $texto = !empty($this->entrega->getElementsByTagName("CEP")->item(0)->nodeValue) ?
1635 1635
             $this->entrega->getElementsByTagName("CEP")->item(0)->nodeValue : '';
1636 1636
         $texto = $this->formatField($texto, "#####-###");
1637 1637
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
@@ -1639,7 +1639,7 @@  discard block
 block discarded – undo
1639 1639
         //MUNICÍPIO
1640 1640
         $w     = round($maxW * 0.805, 0);
1641 1641
         $w1    = $w;
1642
-        $y     += $h;
1642
+        $y += $h;
1643 1643
         $x     = $oldX;
1644 1644
         $texto = 'MUNICÍPIO';
1645 1645
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
@@ -1651,7 +1651,7 @@  discard block
 block discarded – undo
1651 1651
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1652 1652
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 0, '');
1653 1653
         //UF
1654
-        $x     += $w;
1654
+        $x += $w;
1655 1655
         $w     = 8;
1656 1656
         $texto = 'UF';
1657 1657
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
@@ -1660,12 +1660,12 @@  discard block
 block discarded – undo
1660 1660
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1661 1661
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1662 1662
         //FONE / FAX
1663
-        $x     += $w;
1663
+        $x += $w;
1664 1664
         $w     = $maxW - $w - $w1;
1665 1665
         $texto = 'FONE / FAX';
1666 1666
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
1667 1667
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1668
-        $texto = ! empty($this->entrega->getElementsByTagName("fone")->item(0)->nodeValue) ?
1668
+        $texto = !empty($this->entrega->getElementsByTagName("fone")->item(0)->nodeValue) ?
1669 1669
             $this->entrega->getElementsByTagName("fone")->item(0)->nodeValue : '';
1670 1670
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1671 1671
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
@@ -1702,7 +1702,7 @@  discard block
 block discarded – undo
1702 1702
         //NOME / RAZÃO SOCIAL
1703 1703
         $w     = round($maxW * 0.61, 0);
1704 1704
         $w1    = $w;
1705
-        $y     += 3;
1705
+        $y += 3;
1706 1706
         $texto = 'NOME / RAZÃO SOCIAL';
1707 1707
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
1708 1708
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
@@ -1717,20 +1717,20 @@  discard block
 block discarded – undo
1717 1717
             $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 1, '');
1718 1718
         }
1719 1719
         //CNPJ / CPF
1720
-        $x     += $w;
1720
+        $x += $w;
1721 1721
         $w     = round($maxW * 0.23, 0);
1722 1722
         $w2    = $w;
1723 1723
         $texto = 'CNPJ / CPF';
1724 1724
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
1725 1725
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1726 1726
         //Pegando valor do CPF/CNPJ
1727
-        if (! empty($this->retirada->getElementsByTagName("CNPJ")->item(0)->nodeValue)) {
1727
+        if (!empty($this->retirada->getElementsByTagName("CNPJ")->item(0)->nodeValue)) {
1728 1728
             $texto = $this->formatField(
1729 1729
                 $this->retirada->getElementsByTagName("CNPJ")->item(0)->nodeValue,
1730 1730
                 "###.###.###/####-##"
1731 1731
             );
1732 1732
         } else {
1733
-            $texto = ! empty($this->retirada->getElementsByTagName("CPF")->item(0)->nodeValue) ?
1733
+            $texto = !empty($this->retirada->getElementsByTagName("CPF")->item(0)->nodeValue) ?
1734 1734
                 $this->formatField(
1735 1735
                     $this->retirada->getElementsByTagName("CPF")->item(0)->nodeValue,
1736 1736
                     "###.###.###-##"
@@ -1739,7 +1739,7 @@  discard block
 block discarded – undo
1739 1739
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1740 1740
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1741 1741
         //INSCRIÇÃO ESTADUAL
1742
-        $x     += $w;
1742
+        $x += $w;
1743 1743
         $w     = $maxW - ($w1 + $w2);
1744 1744
         $wx    = $w;
1745 1745
         $texto = 'INSCRIÇÃO ESTADUAL';
@@ -1758,7 +1758,7 @@  discard block
 block discarded – undo
1758 1758
         //ENDEREÇO
1759 1759
         $w     = round($maxW * 0.355, 0) + $wx;
1760 1760
         $w1    = $w;
1761
-        $y     += $h;
1761
+        $y += $h;
1762 1762
         $x     = $oldX;
1763 1763
         $texto = 'ENDEREÇO';
1764 1764
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
@@ -1769,7 +1769,7 @@  discard block
 block discarded – undo
1769 1769
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1770 1770
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 0, '', true);
1771 1771
         //BAIRRO / DISTRITO
1772
-        $x     += $w;
1772
+        $x += $w;
1773 1773
         $w     = round($maxW * 0.335, 0);
1774 1774
         $w2    = $w;
1775 1775
         $texto = 'BAIRRO / DISTRITO';
@@ -1779,12 +1779,12 @@  discard block
 block discarded – undo
1779 1779
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1780 1780
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1781 1781
         //CEP
1782
-        $x     += $w;
1782
+        $x += $w;
1783 1783
         $w     = $maxW - ($w1 + $w2);
1784 1784
         $texto = 'CEP';
1785 1785
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
1786 1786
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1787
-        $texto = ! empty($this->retirada->getElementsByTagName("CEP")->item(0)->nodeValue) ?
1787
+        $texto = !empty($this->retirada->getElementsByTagName("CEP")->item(0)->nodeValue) ?
1788 1788
             $this->retirada->getElementsByTagName("CEP")->item(0)->nodeValue : '';
1789 1789
         $texto = $this->formatField($texto, "#####-###");
1790 1790
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
@@ -1792,7 +1792,7 @@  discard block
 block discarded – undo
1792 1792
         //MUNICÍPIO
1793 1793
         $w     = round($maxW * 0.805, 0);
1794 1794
         $w1    = $w;
1795
-        $y     += $h;
1795
+        $y += $h;
1796 1796
         $x     = $oldX;
1797 1797
         $texto = 'MUNICÍPIO';
1798 1798
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
@@ -1804,7 +1804,7 @@  discard block
 block discarded – undo
1804 1804
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1805 1805
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 0, '');
1806 1806
         //UF
1807
-        $x     += $w;
1807
+        $x += $w;
1808 1808
         $w     = 8;
1809 1809
         $texto = 'UF';
1810 1810
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
@@ -1813,12 +1813,12 @@  discard block
 block discarded – undo
1813 1813
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1814 1814
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1815 1815
         //FONE / FAX
1816
-        $x     += $w;
1816
+        $x += $w;
1817 1817
         $w     = $maxW - $w - $w1;
1818 1818
         $texto = 'FONE / FAX';
1819 1819
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
1820 1820
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1821
-        $texto = ! empty($this->retirada->getElementsByTagName("fone")->item(0)->nodeValue) ?
1821
+        $texto = !empty($this->retirada->getElementsByTagName("fone")->item(0)->nodeValue) ?
1822 1822
             $this->retirada->getElementsByTagName("fone")->item(0)->nodeValue : '';
1823 1823
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
1824 1824
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
@@ -1838,7 +1838,7 @@  discard block
 block discarded – undo
1838 1838
         if (isset($this->cobr)) {
1839 1839
             $fat = $this->cobr->getElementsByTagName("fat")->item(0);
1840 1840
             if (isset($fat)) {
1841
-                if (! empty($this->getTagValue($this->ide, "indPag"))) {
1841
+                if (!empty($this->getTagValue($this->ide, "indPag"))) {
1842 1842
                     $textoIndPag = "";
1843 1843
                     $indPag      = $this->getTagValue($this->ide, "indPag");
1844 1844
                     if ($indPag === "0") {
@@ -1912,7 +1912,7 @@  discard block
 block discarded – undo
1912 1912
             $h     = 8;
1913 1913
             $aFont = ['font' => $this->fontePadrao, 'size' => 7, 'style' => 'B'];
1914 1914
             $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
1915
-            $y       += 3;
1915
+            $y += 3;
1916 1916
             $dups    = "";
1917 1917
             $dupcont = 0;
1918 1918
             $nFat    = $this->dup->length;
@@ -1946,13 +1946,13 @@  discard block
 block discarded – undo
1946 1946
             }
1947 1947
             $increm = 1;
1948 1948
             foreach ($this->dup as $k => $d) {
1949
-                $nDup  = ! empty($this->dup->item($k)->getElementsByTagName('nDup')->item(0)->nodeValue)
1949
+                $nDup  = !empty($this->dup->item($k)->getElementsByTagName('nDup')->item(0)->nodeValue)
1950 1950
                     ? $this->dup->item($k)->getElementsByTagName('nDup')->item(0)->nodeValue
1951 1951
                     : '';
1952
-                $dDup  = ! empty($this->dup->item($k)->getElementsByTagName('dVenc')->item(0)->nodeValue)
1952
+                $dDup  = !empty($this->dup->item($k)->getElementsByTagName('dVenc')->item(0)->nodeValue)
1953 1953
                     ? $this->ymdTodmy($this->dup->item($k)->getElementsByTagName('dVenc')->item(0)->nodeValue)
1954 1954
                     : '';
1955
-                $vDup  = ! empty($this->dup->item($k)->getElementsByTagName('vDup')->item(0)->nodeValue)
1955
+                $vDup  = !empty($this->dup->item($k)->getElementsByTagName('vDup')->item(0)->nodeValue)
1956 1956
                     ? 'R$ ' . number_format(
1957 1957
                         $this->dup->item($k)->getElementsByTagName('vDup')->item(0)->nodeValue,
1958 1958
                         2,
@@ -1999,7 +1999,7 @@  discard block
 block discarded – undo
1999 1999
             }
2000 2000
             if ($dupcont == 0) {
2001 2001
                 $y -= 9;
2002
-                $linha --;
2002
+                $linha--;
2003 2003
             }
2004 2004
 
2005 2005
             return ($y + $h);
@@ -2039,7 +2039,7 @@  discard block
 block discarded – undo
2039 2039
             $h     = 8;
2040 2040
             $aFont = ['font' => $this->fontePadrao, 'size' => 7, 'style' => 'B'];
2041 2041
             $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
2042
-            $y       += 3;
2042
+            $y += 3;
2043 2043
             $dups    = "";
2044 2044
             $dupcont = 0;
2045 2045
             if ($this->orientacao == 'P') {
@@ -2072,7 +2072,7 @@  discard block
 block discarded – undo
2072 2072
                 '90' => 'Sem pagamento',
2073 2073
                 '99' => 'Outros'
2074 2074
             ];
2075
-            $bandeira       = [
2075
+            $bandeira = [
2076 2076
                 '01' => 'Visa',
2077 2077
                 '02' => 'Mastercard',
2078 2078
                 '03' => 'American',
@@ -2085,10 +2085,10 @@  discard block
 block discarded – undo
2085 2085
                 '99' => 'Outros'
2086 2086
             ];
2087 2087
             foreach ($this->detPag as $k => $d) {
2088
-                $fPag  = ! empty($this->detPag->item($k)->getElementsByTagName('tPag')->item(0)->nodeValue)
2088
+                $fPag  = !empty($this->detPag->item($k)->getElementsByTagName('tPag')->item(0)->nodeValue)
2089 2089
                     ? $this->detPag->item($k)->getElementsByTagName('tPag')->item(0)->nodeValue
2090 2090
                     : '0';
2091
-                $vPag  = ! empty($this->detPag->item($k)->getElementsByTagName('vPag')->item(0)->nodeValue)
2091
+                $vPag  = !empty($this->detPag->item($k)->getElementsByTagName('vPag')->item(0)->nodeValue)
2092 2092
                     ? 'R$ ' . number_format(
2093 2093
                         $this->detPag->item($k)->getElementsByTagName('vPag')->item(0)->nodeValue,
2094 2094
                         2,
@@ -2131,7 +2131,7 @@  discard block
 block discarded – undo
2131 2131
             }
2132 2132
             if ($dupcont == 0) {
2133 2133
                 $y -= 9;
2134
-                $linha --;
2134
+                $linha--;
2135 2135
             }
2136 2136
 
2137 2137
             return ($y + $h);
@@ -2163,7 +2163,7 @@  discard block
 block discarded – undo
2163 2163
         $the_field    = $this->ICMSTot->getElementsByTagName($campoImposto)->item(0);
2164 2164
         if (isset($the_field)) {
2165 2165
             $the_value = $the_field->nodeValue;
2166
-            if (! empty($the_value)) {
2166
+            if (!empty($the_value)) {
2167 2167
                 $valorImposto = number_format($the_value, 2, ",", ".");
2168 2168
             }
2169 2169
         }
@@ -2192,10 +2192,10 @@  discard block
 block discarded – undo
2192 2192
         $x_inicial = $x;
2193 2193
         //#####################################################################
2194 2194
         $campos_por_linha = 9;
2195
-        if (! $this->exibirPIS) {
2196
-            $campos_por_linha --;
2195
+        if (!$this->exibirPIS) {
2196
+            $campos_por_linha--;
2197 2197
         }
2198
-        if (! $this->exibirIcmsInterestadual) {
2198
+        if (!$this->exibirIcmsInterestadual) {
2199 2199
             $campos_por_linha -= 2;
2200 2200
         }
2201 2201
 
@@ -2282,12 +2282,12 @@  discard block
 block discarded – undo
2282 2282
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
2283 2283
         //NOME / RAZÃO SOCIAL
2284 2284
         $w1    = $maxW * 0.29;
2285
-        $y     += 3;
2285
+        $y += 3;
2286 2286
         $texto = 'NOME / RAZÃO SOCIAL';
2287 2287
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2288 2288
         $this->pdf->textBox($x, $y, $w1, $h, $texto, $aFont, 'T', 'L', 1, '');
2289 2289
         if (isset($this->transporta)) {
2290
-            $texto = ! empty($this->transporta->getElementsByTagName("xNome")->item(0)->nodeValue)
2290
+            $texto = !empty($this->transporta->getElementsByTagName("xNome")->item(0)->nodeValue)
2291 2291
                 ? $this->transporta->getElementsByTagName("xNome")->item(0)->nodeValue
2292 2292
                 : '';
2293 2293
         } else {
@@ -2296,12 +2296,12 @@  discard block
 block discarded – undo
2296 2296
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
2297 2297
         $this->pdf->textBox($x, $y, $w1, $h, $texto, $aFont, 'B', 'L', 0, '');
2298 2298
         //FRETE POR CONTA
2299
-        $x     += $w1;
2299
+        $x += $w1;
2300 2300
         $w2    = $maxW * 0.15;
2301 2301
         $texto = 'FRETE';
2302 2302
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2303 2303
         $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'T', 'L', 1, '');
2304
-        $tipoFrete = ! empty($this->transp->getElementsByTagName("modFrete")->item(0)->nodeValue)
2304
+        $tipoFrete = !empty($this->transp->getElementsByTagName("modFrete")->item(0)->nodeValue)
2305 2305
             ? $this->transp->getElementsByTagName("modFrete")->item(0)->nodeValue
2306 2306
             : '0';
2307 2307
         switch ($tipoFrete) {
@@ -2327,12 +2327,12 @@  discard block
 block discarded – undo
2327 2327
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
2328 2328
         $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'C', 'C', 1, '');
2329 2329
         //CÓDIGO ANTT
2330
-        $x     += $w2;
2330
+        $x += $w2;
2331 2331
         $texto = 'CÓDIGO ANTT';
2332 2332
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2333 2333
         $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'T', 'L', 1, '');
2334 2334
         if (isset($this->veicTransp)) {
2335
-            $texto = ! empty($this->veicTransp->getElementsByTagName("RNTC")->item(0)->nodeValue)
2335
+            $texto = !empty($this->veicTransp->getElementsByTagName("RNTC")->item(0)->nodeValue)
2336 2336
                 ? $this->veicTransp->getElementsByTagName("RNTC")->item(0)->nodeValue
2337 2337
                 : '';
2338 2338
         } else {
@@ -2341,16 +2341,16 @@  discard block
 block discarded – undo
2341 2341
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
2342 2342
         $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'B', 'C', 0, '');
2343 2343
         //PLACA DO VEÍC
2344
-        $x     += $w2;
2344
+        $x += $w2;
2345 2345
         $texto = 'PLACA DO VEÍCULO';
2346 2346
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2347 2347
         $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'T', 'L', 1, '');
2348 2348
         if (isset($this->veicTransp)) {
2349
-            $texto = ! empty($this->veicTransp->getElementsByTagName("placa")->item(0)->nodeValue)
2349
+            $texto = !empty($this->veicTransp->getElementsByTagName("placa")->item(0)->nodeValue)
2350 2350
                 ? $this->veicTransp->getElementsByTagName("placa")->item(0)->nodeValue
2351 2351
                 : '';
2352 2352
         } elseif (isset($this->reboque)) {
2353
-            $texto = ! empty($this->reboque->getElementsByTagName("placa")->item(0)->nodeValue)
2353
+            $texto = !empty($this->reboque->getElementsByTagName("placa")->item(0)->nodeValue)
2354 2354
                 ? $this->reboque->getElementsByTagName("placa")->item(0)->nodeValue
2355 2355
                 : '';
2356 2356
         } else {
@@ -2359,17 +2359,17 @@  discard block
 block discarded – undo
2359 2359
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
2360 2360
         $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'B', 'C', 0, '');
2361 2361
         //UF
2362
-        $x     += $w2;
2362
+        $x += $w2;
2363 2363
         $w3    = round($maxW * 0.04, 0);
2364 2364
         $texto = 'UF';
2365 2365
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2366 2366
         $this->pdf->textBox($x, $y, $w3, $h, $texto, $aFont, 'T', 'L', 1, '');
2367 2367
         if (isset($this->veicTransp)) {
2368
-            $texto = ! empty($this->veicTransp->getElementsByTagName("UF")->item(0)->nodeValue)
2368
+            $texto = !empty($this->veicTransp->getElementsByTagName("UF")->item(0)->nodeValue)
2369 2369
                 ? $this->veicTransp->getElementsByTagName("UF")->item(0)->nodeValue
2370 2370
                 : '';
2371 2371
         } elseif (isset($this->reboque)) {
2372
-            $texto = ! empty($this->reboque->getElementsByTagName("UF")->item(0)->nodeValue)
2372
+            $texto = !empty($this->reboque->getElementsByTagName("UF")->item(0)->nodeValue)
2373 2373
                 ? $this->reboque->getElementsByTagName("UF")->item(0)->nodeValue
2374 2374
                 : '';
2375 2375
         } else {
@@ -2378,20 +2378,20 @@  discard block
 block discarded – undo
2378 2378
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
2379 2379
         $this->pdf->textBox($x, $y, $w3, $h, $texto, $aFont, 'B', 'C', 0, '');
2380 2380
         //CNPJ / CPF
2381
-        $x     += $w3;
2381
+        $x += $w3;
2382 2382
         $w     = $maxW - ($w1 + 3 * $w2 + $w3);
2383 2383
         $texto = 'CNPJ / CPF';
2384 2384
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2385 2385
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
2386 2386
         if (isset($this->transporta)) {
2387
-            $texto = ! empty($this->transporta->getElementsByTagName("CNPJ")->item(0)->nodeValue)
2387
+            $texto = !empty($this->transporta->getElementsByTagName("CNPJ")->item(0)->nodeValue)
2388 2388
                 ? $this->formatField(
2389 2389
                     $this->transporta->getElementsByTagName("CNPJ")->item(0)->nodeValue,
2390 2390
                     "##.###.###/####-##"
2391 2391
                 )
2392 2392
                 : '';
2393 2393
             if ($texto == '') {
2394
-                $texto = ! empty($this->transporta->getElementsByTagName("CPF")->item(0)->nodeValue)
2394
+                $texto = !empty($this->transporta->getElementsByTagName("CPF")->item(0)->nodeValue)
2395 2395
                     ? $this->formatField(
2396 2396
                         $this->transporta->getElementsByTagName("CPF")->item(0)->nodeValue,
2397 2397
                         "###.###.###-##"
@@ -2405,7 +2405,7 @@  discard block
 block discarded – undo
2405 2405
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
2406 2406
         //#####################################################################
2407 2407
         //ENDEREÇO
2408
-        $y     += $h;
2408
+        $y += $h;
2409 2409
         $x     = $oldX;
2410 2410
         $h     = 7;
2411 2411
         $w1    = $maxW * 0.44;
@@ -2413,7 +2413,7 @@  discard block
 block discarded – undo
2413 2413
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2414 2414
         $this->pdf->textBox($x, $y, $w1, $h, $texto, $aFont, 'T', 'L', 1, '');
2415 2415
         if (isset($this->transporta)) {
2416
-            $texto = ! empty($this->transporta->getElementsByTagName("xEnder")->item(0)->nodeValue)
2416
+            $texto = !empty($this->transporta->getElementsByTagName("xEnder")->item(0)->nodeValue)
2417 2417
                 ? $this->transporta->getElementsByTagName("xEnder")->item(0)->nodeValue
2418 2418
                 : '';
2419 2419
         } else {
@@ -2422,13 +2422,13 @@  discard block
 block discarded – undo
2422 2422
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
2423 2423
         $this->pdf->textBox($x, $y, $w1, $h, $texto, $aFont, 'B', 'L', 0, '');
2424 2424
         //MUNICÍPIO
2425
-        $x     += $w1;
2425
+        $x += $w1;
2426 2426
         $w2    = round($maxW * 0.30, 0);
2427 2427
         $texto = 'MUNICÍPIO';
2428 2428
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2429 2429
         $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'T', 'L', 1, '');
2430 2430
         if (isset($this->transporta)) {
2431
-            $texto = ! empty($this->transporta->getElementsByTagName("xMun")->item(0)->nodeValue)
2431
+            $texto = !empty($this->transporta->getElementsByTagName("xMun")->item(0)->nodeValue)
2432 2432
                 ? $this->transporta->getElementsByTagName("xMun")->item(0)->nodeValue
2433 2433
                 : '';
2434 2434
         } else {
@@ -2437,13 +2437,13 @@  discard block
 block discarded – undo
2437 2437
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
2438 2438
         $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'B', 'C', 0, '');
2439 2439
         //UF
2440
-        $x     += $w2;
2440
+        $x += $w2;
2441 2441
         $w3    = round($maxW * 0.04, 0);
2442 2442
         $texto = 'UF';
2443 2443
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2444 2444
         $this->pdf->textBox($x, $y, $w3, $h, $texto, $aFont, 'T', 'L', 1, '');
2445 2445
         if (isset($this->transporta)) {
2446
-            $texto = ! empty($this->transporta->getElementsByTagName("UF")->item(0)->nodeValue)
2446
+            $texto = !empty($this->transporta->getElementsByTagName("UF")->item(0)->nodeValue)
2447 2447
                 ? $this->transporta->getElementsByTagName("UF")->item(0)->nodeValue
2448 2448
                 : '';
2449 2449
         } else {
@@ -2452,14 +2452,14 @@  discard block
 block discarded – undo
2452 2452
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
2453 2453
         $this->pdf->textBox($x, $y, $w3, $h, $texto, $aFont, 'B', 'C', 0, '');
2454 2454
         //INSCRIÇÃO ESTADUAL
2455
-        $x     += $w3;
2455
+        $x += $w3;
2456 2456
         $w     = $maxW - ($w1 + $w2 + $w3);
2457 2457
         $texto = 'INSCRIÇÃO ESTADUAL';
2458 2458
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2459 2459
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
2460 2460
         $texto = '';
2461 2461
         if (isset($this->transporta)) {
2462
-            if (! empty($this->transporta->getElementsByTagName("IE")->item(0)->nodeValue)) {
2462
+            if (!empty($this->transporta->getElementsByTagName("IE")->item(0)->nodeValue)) {
2463 2463
                 $texto = $this->transporta->getElementsByTagName("IE")->item(0)->nodeValue;
2464 2464
             }
2465 2465
         }
@@ -2475,13 +2475,13 @@  discard block
 block discarded – undo
2475 2475
         $pesoBruto   = 0;
2476 2476
         $pesoLiquido = 0;
2477 2477
         foreach ($volumes as $volume) {
2478
-            $quantidade  += ! empty($volume->getElementsByTagName("qVol")->item(0)->nodeValue) ?
2478
+            $quantidade  += !empty($volume->getElementsByTagName("qVol")->item(0)->nodeValue) ?
2479 2479
                 $volume->getElementsByTagName("qVol")->item(0)->nodeValue : 0;
2480
-            $pesoBruto   += ! empty($volume->getElementsByTagName("pesoB")->item(0)->nodeValue) ?
2480
+            $pesoBruto   += !empty($volume->getElementsByTagName("pesoB")->item(0)->nodeValue) ?
2481 2481
                 $volume->getElementsByTagName("pesoB")->item(0)->nodeValue : 0;
2482
-            $pesoLiquido += ! empty($volume->getElementsByTagName("pesoL")->item(0)->nodeValue) ?
2482
+            $pesoLiquido += !empty($volume->getElementsByTagName("pesoL")->item(0)->nodeValue) ?
2483 2483
                 $volume->getElementsByTagName("pesoL")->item(0)->nodeValue : 0;
2484
-            $texto       = ! empty($this->transp->getElementsByTagName("esp")->item(0)->nodeValue) ?
2484
+            $texto = !empty($this->transp->getElementsByTagName("esp")->item(0)->nodeValue) ?
2485 2485
                 $this->transp->getElementsByTagName("esp")->item(0)->nodeValue : '';
2486 2486
             if ($texto != $especie && $especie != '') {
2487 2487
                 //tem várias especies
@@ -2489,7 +2489,7 @@  discard block
 block discarded – undo
2489 2489
             } else {
2490 2490
                 $especie = $texto;
2491 2491
             }
2492
-            $texto = ! empty($this->transp->getElementsByTagName("marca")->item(0)->nodeValue)
2492
+            $texto = !empty($this->transp->getElementsByTagName("marca")->item(0)->nodeValue)
2493 2493
                 ? $this->transp->getElementsByTagName("marca")->item(0)->nodeValue
2494 2494
                 : '';
2495 2495
             if ($texto != $marca && $marca != '') {
@@ -2498,7 +2498,7 @@  discard block
 block discarded – undo
2498 2498
             } else {
2499 2499
                 $marca = $texto;
2500 2500
             }
2501
-            $texto = ! empty($this->transp->getElementsByTagName("nVol")->item(0)->nodeValue)
2501
+            $texto = !empty($this->transp->getElementsByTagName("nVol")->item(0)->nodeValue)
2502 2502
                 ? $this->transp->getElementsByTagName("nVol")->item(0)->nodeValue
2503 2503
                 : '';
2504 2504
             if ($texto != $numero && $numero != '') {
@@ -2511,20 +2511,20 @@  discard block
 block discarded – undo
2511 2511
 
2512 2512
         //#####################################################################
2513 2513
         //QUANTIDADE
2514
-        $y     += $h;
2514
+        $y += $h;
2515 2515
         $x     = $oldX;
2516 2516
         $h     = 7;
2517 2517
         $w1    = round($maxW * 0.10, 0);
2518 2518
         $texto = 'QUANTIDADE';
2519 2519
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2520 2520
         $this->pdf->textBox($x, $y, $w1, $h, $texto, $aFont, 'T', 'L', 1, '');
2521
-        if (! empty($quantidade)) {
2521
+        if (!empty($quantidade)) {
2522 2522
             $texto = $quantidade;
2523 2523
             $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
2524 2524
             $this->pdf->textBox($x, $y, $w1, $h, $texto, $aFont, 'B', 'C', 0, '');
2525 2525
         }
2526 2526
         //ESPÉCIE
2527
-        $x     += $w1;
2527
+        $x += $w1;
2528 2528
         $w2    = round($maxW * 0.17, 0);
2529 2529
         $texto = 'ESPÉCIE';
2530 2530
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
@@ -2533,16 +2533,16 @@  discard block
 block discarded – undo
2533 2533
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
2534 2534
         $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'B', 'C', 0, '');
2535 2535
         //MARCA
2536
-        $x     += $w2;
2536
+        $x += $w2;
2537 2537
         $texto = 'MARCA';
2538 2538
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2539 2539
         $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'T', 'L', 1, '');
2540
-        $texto = ! empty($this->transp->getElementsByTagName("marca")->item(0)->nodeValue) ?
2540
+        $texto = !empty($this->transp->getElementsByTagName("marca")->item(0)->nodeValue) ?
2541 2541
             $this->transp->getElementsByTagName("marca")->item(0)->nodeValue : '';
2542 2542
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
2543 2543
         $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'B', 'C', 0, '');
2544 2544
         //NUMERAÇÃO
2545
-        $x     += $w2;
2545
+        $x += $w2;
2546 2546
         $texto = 'NUMERAÇÃO';
2547 2547
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2548 2548
         $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'T', 'L', 1, '');
@@ -2550,7 +2550,7 @@  discard block
 block discarded – undo
2550 2550
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
2551 2551
         $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'B', 'C', 0, '');
2552 2552
         //PESO BRUTO
2553
-        $x     += $w2;
2553
+        $x += $w2;
2554 2554
         $w3    = round($maxW * 0.20, 0);
2555 2555
         $texto = 'PESO BRUTO';
2556 2556
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
@@ -2563,7 +2563,7 @@  discard block
 block discarded – undo
2563 2563
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
2564 2564
         $this->pdf->textBox($x, $y, $w3, $h, $texto, $aFont, 'B', 'R', 0, '');
2565 2565
         //PESO LÍQUIDO
2566
-        $x     += $w3;
2566
+        $x += $w3;
2567 2567
         $w     = $maxW - ($w1 + 3 * $w2 + $w3);
2568 2568
         $texto = 'PESO LÍQUIDO';
2569 2569
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
@@ -2583,11 +2583,11 @@  discard block
 block discarded – undo
2583 2583
     protected function descricaoProdutoHelper($origem, $campo, $formato)
2584 2584
     {
2585 2585
         $valor_original = $origem->getElementsByTagName($campo)->item(0);
2586
-        if (! isset($valor_original)) {
2586
+        if (!isset($valor_original)) {
2587 2587
             return "";
2588 2588
         }
2589 2589
         $valor_original = $valor_original->nodeValue;
2590
-        $valor          = ! empty($valor_original) ? number_format($valor_original, 2, ",", ".") : '';
2590
+        $valor          = !empty($valor_original) ? number_format($valor_original, 2, ",", ".") : '';
2591 2591
 
2592 2592
         if ($valor != "") {
2593 2593
             return sprintf($formato, $valor);
@@ -2613,7 +2613,7 @@  discard block
 block discarded – undo
2613 2613
         $ICMSUFDest = $itemProd->getElementsByTagName("ICMSUFDest")->item(0);
2614 2614
         $impostos   = '';
2615 2615
 
2616
-        if (! empty($ICMS)) {
2616
+        if (!empty($ICMS)) {
2617 2617
             $impostos .= $this->descricaoProdutoHelper($ICMS, "vBCFCP", " BcFcp=%s");
2618 2618
             $impostos .= $this->descricaoProdutoHelper($ICMS, "pFCP", " pFcp=%s%%");
2619 2619
             $impostos .= $this->descricaoProdutoHelper($ICMS, "vFCP", " vFcp=%s");
@@ -2629,7 +2629,7 @@  discard block
 block discarded – undo
2629 2629
             $impostos .= $this->descricaoProdutoHelper($ICMS, "pST", " pSt=%s");
2630 2630
             $impostos .= $this->descricaoProdutoHelper($ICMS, "vICMSSTRet", " VALOR ICMS ST=%s");
2631 2631
         }
2632
-        if (! empty($ICMSUFDest)) {
2632
+        if (!empty($ICMSUFDest)) {
2633 2633
             $impostos .= $this->descricaoProdutoHelper($ICMSUFDest, "pFCPUFDest", " pFCPUFDest=%s%%");
2634 2634
             $impostos .= $this->descricaoProdutoHelper($ICMSUFDest, "pICMSUFDest", " pICMSUFDest=%s%%");
2635 2635
             $impostos .= $this->descricaoProdutoHelper($ICMSUFDest, "pICMSInterPart", " pICMSInterPart=%s%%");
@@ -2637,20 +2637,20 @@  discard block
 block discarded – undo
2637 2637
             $impostos .= $this->descricaoProdutoHelper($ICMSUFDest, "vICMSUFDest", " vICMSUFDest=%s");
2638 2638
             $impostos .= $this->descricaoProdutoHelper($ICMSUFDest, "vICMSUFRemet", " vICMSUFRemet=%s");
2639 2639
         }
2640
-        $infAdProd = ! empty($itemProd->getElementsByTagName('infAdProd')->item(0)->nodeValue)
2640
+        $infAdProd = !empty($itemProd->getElementsByTagName('infAdProd')->item(0)->nodeValue)
2641 2641
             ? substr(
2642 2642
                 $this->anfaveaDANFE($itemProd->getElementsByTagName('infAdProd')->item(0)->nodeValue),
2643 2643
                 0,
2644 2644
                 500
2645 2645
             )
2646 2646
             : '';
2647
-        if (! empty($infAdProd)) {
2647
+        if (!empty($infAdProd)) {
2648 2648
             $infAdProd = trim($infAdProd);
2649 2649
             $infAdProd .= ' ';
2650 2650
         }
2651 2651
         $loteTxt = '';
2652 2652
         $rastro  = $prod->getElementsByTagName("med");
2653
-        if (! empty($prod->getElementsByTagName("rastro"))) {
2653
+        if (!empty($prod->getElementsByTagName("rastro"))) {
2654 2654
             $rastro = $prod->getElementsByTagName("rastro");
2655 2655
             $i      = 0;
2656 2656
             while ($i < $rastro->length) {
@@ -2659,14 +2659,14 @@  discard block
 block discarded – undo
2659 2659
                 $loteTxt .= $this->getTagDate($rastro->item($i), 'dFab', ' Fab: ');
2660 2660
                 $loteTxt .= $this->getTagDate($rastro->item($i), 'dVal', ' Val: ');
2661 2661
                 $loteTxt .= $this->getTagValue($rastro->item($i), 'vPMC', ' PMC: ');
2662
-                $i ++;
2662
+                $i++;
2663 2663
             }
2664 2664
             if ($loteTxt != '') {
2665 2665
                 $loteTxt .= ' ';
2666 2666
             }
2667 2667
         }
2668 2668
         //NT2013.006 FCI
2669
-        $nFCI   = (! empty($itemProd->getElementsByTagName('nFCI')->item(0)->nodeValue)) ?
2669
+        $nFCI   = (!empty($itemProd->getElementsByTagName('nFCI')->item(0)->nodeValue)) ?
2670 2670
             ' FCI:' . $itemProd->getElementsByTagName('nFCI')->item(0)->nodeValue : '';
2671 2671
         $tmp_ad = $infAdProd . ($this->descProdInfoComplemento ? $loteTxt . $impostos . $nFCI : '');
2672 2672
         $texto  = $prod->getElementsByTagName("xProd")->item(0)->nodeValue
@@ -2716,7 +2716,7 @@  discard block
 block discarded – undo
2716 2716
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
2717 2717
         $y += 3;
2718 2718
         //desenha a caixa dos dados dos itens da NF
2719
-        $hmax  += 1;
2719
+        $hmax += 1;
2720 2720
         $texto = '';
2721 2721
         $this->pdf->textBox($x, $y, $w, $hmax);
2722 2722
         //##################################################################################
@@ -2729,101 +2729,101 @@  discard block
 block discarded – undo
2729 2729
         $this->pdf->textBox($x, $y, $w1, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2730 2730
         $this->pdf->line($x + $w1, $y, $x + $w1, $y + $hmax);
2731 2731
         //DESCRIÇÃO DO PRODUTO / SERVIÇO
2732
-        $x     += $w1;
2732
+        $x += $w1;
2733 2733
         $w2    = round($w * 0.25, 0);
2734 2734
         $texto = 'DESCRIÇÃO DO PRODUTO / SERVIÇO';
2735 2735
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2736 2736
         $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2737 2737
         $this->pdf->line($x + $w2, $y, $x + $w2, $y + $hmax);
2738 2738
         //NCM/SH
2739
-        $x     += $w2;
2739
+        $x += $w2;
2740 2740
         $w3    = round($w * 0.06, 0);
2741 2741
         $texto = 'NCM/SH';
2742 2742
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2743 2743
         $this->pdf->textBox($x, $y, $w3, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2744 2744
         $this->pdf->line($x + $w3, $y, $x + $w3, $y + $hmax);
2745 2745
         //O/CST ou O/CSOSN
2746
-        $x     += $w3;
2746
+        $x += $w3;
2747 2747
         $w4    = round($w * 0.05, 0);
2748 2748
         $texto = 'O/CST'; // CRT = 2 ou CRT = 3
2749 2749
         if ($this->getTagValue($this->emit, 'CRT') == '1') {
2750
-            $texto = 'O/CSOSN';//Regime do Simples CRT = 1
2750
+            $texto = 'O/CSOSN'; //Regime do Simples CRT = 1
2751 2751
         }
2752 2752
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2753 2753
         $this->pdf->textBox($x, $y, $w4, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2754 2754
         $this->pdf->line($x + $w4, $y, $x + $w4, $y + $hmax);
2755 2755
         //CFOP
2756
-        $x     += $w4;
2756
+        $x += $w4;
2757 2757
         $w5    = round($w * 0.04, 0);
2758 2758
         $texto = 'CFOP';
2759 2759
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2760 2760
         $this->pdf->textBox($x, $y, $w5, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2761 2761
         $this->pdf->line($x + $w5, $y, $x + $w5, $y + $hmax);
2762 2762
         //UN
2763
-        $x     += $w5;
2763
+        $x += $w5;
2764 2764
         $w6    = round($w * 0.03, 0);
2765 2765
         $texto = 'UN';
2766 2766
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2767 2767
         $this->pdf->textBox($x, $y, $w6, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2768 2768
         $this->pdf->line($x + $w6, $y, $x + $w6, $y + $hmax);
2769 2769
         //QUANT
2770
-        $x     += $w6;
2770
+        $x += $w6;
2771 2771
         $w7    = round($w * 0.08, 0);
2772 2772
         $texto = 'QUANT';
2773 2773
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2774 2774
         $this->pdf->textBox($x, $y, $w7, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2775 2775
         $this->pdf->line($x + $w7, $y, $x + $w7, $y + $hmax);
2776 2776
         //VALOR UNIT
2777
-        $x     += $w7;
2777
+        $x += $w7;
2778 2778
         $w8    = round($w * 0.06, 0);
2779 2779
         $texto = 'VALOR UNIT';
2780 2780
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2781 2781
         $this->pdf->textBox($x, $y, $w8, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2782 2782
         $this->pdf->line($x + $w8, $y, $x + $w8, $y + $hmax);
2783 2783
         //VALOR TOTAL
2784
-        $x     += $w8;
2784
+        $x += $w8;
2785 2785
         $w9    = round($w * 0.06, 0);
2786 2786
         $texto = 'VALOR TOTAL';
2787 2787
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2788 2788
         $this->pdf->textBox($x, $y, $w9, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2789 2789
         $this->pdf->line($x + $w9, $y, $x + $w9, $y + $hmax);
2790 2790
         //VALOR DESCONTO
2791
-        $x     += $w9;
2791
+        $x += $w9;
2792 2792
         $w10   = round($w * 0.05, 0);
2793 2793
         $texto = 'VALOR DESC';
2794 2794
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2795 2795
         $this->pdf->textBox($x, $y, $w10, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2796 2796
         $this->pdf->line($x + $w10, $y, $x + $w10, $y + $hmax);
2797 2797
         //B.CÁLC ICMS
2798
-        $x     += $w10;
2798
+        $x += $w10;
2799 2799
         $w11   = round($w * 0.06, 0);
2800 2800
         $texto = 'B.CÁLC ICMS';
2801 2801
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2802 2802
         $this->pdf->textBox($x, $y, $w11, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2803 2803
         $this->pdf->line($x + $w11, $y, $x + $w11, $y + $hmax);
2804 2804
         //VALOR ICMS
2805
-        $x     += $w11;
2805
+        $x += $w11;
2806 2806
         $w12   = round($w * 0.06, 0);
2807 2807
         $texto = 'VALOR ICMS';
2808 2808
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2809 2809
         $this->pdf->textBox($x, $y, $w12, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2810 2810
         $this->pdf->line($x + $w12, $y, $x + $w12, $y + $hmax);
2811 2811
         //VALOR IPI
2812
-        $x     += $w12;
2812
+        $x += $w12;
2813 2813
         $w13   = round($w * 0.05, 0);
2814 2814
         $texto = 'VALOR IPI';
2815 2815
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2816 2816
         $this->pdf->textBox($x, $y, $w13, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2817 2817
         $this->pdf->line($x + $w13, $y, $x + $w13, $y + $hmax);
2818 2818
         //ALÍQ. ICMS
2819
-        $x     += $w13;
2819
+        $x += $w13;
2820 2820
         $w14   = round($w * 0.04, 0);
2821 2821
         $texto = 'ALÍQ. ICMS';
2822 2822
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
2823 2823
         $this->pdf->textBox($x, $y, $w14, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2824 2824
         $this->pdf->line($x + $w14, $y, $x + $w14, $y + $hmax);
2825 2825
         //ALÍQ. IPI
2826
-        $x     += $w14;
2826
+        $x += $w14;
2827 2827
         $w15   = $w - ($w1 + $w2 + $w3 + $w4 + $w5 + $w6 + $w7 + $w8 + $w9 + $w10 + $w11 + $w12 + $w13 + $w14);
2828 2828
         $texto = 'ALÍQ. IPI';
2829 2829
         $this->pdf->textBox($x, $y, $w15, $h, $texto, $aFont, 'C', 'C', 0, '', false);
@@ -2876,7 +2876,7 @@  discard block
 block discarded – undo
2876 2876
                 // Informação sobre unidade de medida tributavel.
2877 2877
                 // Se não for para exibir a unidade de medida tributavel, então
2878 2878
                 // A Escrita irá começar em 0.
2879
-                if (! $mostrarUnidadeTributavel) {
2879
+                if (!$mostrarUnidadeTributavel) {
2880 2880
                     $yTrib = 0;
2881 2881
                 }
2882 2882
                 $h = $this->calculeHeight($thisItem, $mostrarUnidadeTributavel);
@@ -2911,7 +2911,7 @@  discard block
 block discarded – undo
2911 2911
                 }
2912 2912
                 $x += $w2;
2913 2913
                 //NCM
2914
-                $texto = ! empty($prod->getElementsByTagName("NCM")->item(0)->nodeValue) ?
2914
+                $texto = !empty($prod->getElementsByTagName("NCM")->item(0)->nodeValue) ?
2915 2915
                     $prod->getElementsByTagName("NCM")->item(0)->nodeValue : '';
2916 2916
                 $this->pdf->textBox($x, $y, $w3, $h, $texto, $aFont, 'T', 'C', 0, '');
2917 2917
                 $x += $w3;
@@ -2924,11 +2924,11 @@  discard block
 block discarded – undo
2924 2924
                     $this->pdf->textBox($x, $y, $w4, $h, $texto, $aFont, 'T', 'C', 0, '');
2925 2925
                 }
2926 2926
                 //CFOP
2927
-                $x     += $w4;
2927
+                $x += $w4;
2928 2928
                 $texto = $prod->getElementsByTagName("CFOP")->item(0)->nodeValue;
2929 2929
                 $this->pdf->textBox($x, $y, $w5, $h, $texto, $aFont, 'T', 'C', 0, '');
2930 2930
                 //Unidade
2931
-                $x     += $w5;
2931
+                $x += $w5;
2932 2932
                 $texto = $uCom;
2933 2933
                 $this->pdf->textBox($x, $y, $w6, $h, $texto, $aFont, 'T', 'C', 0, '');
2934 2934
                 //Unidade de medida tributável
@@ -2950,7 +2950,7 @@  discard block
 block discarded – undo
2950 2950
                 // QTDADE Tributável
2951 2951
                 if ($mostrarUnidadeTributavel) {
2952 2952
                     $qTrib = $prod->getElementsByTagName("qTrib")->item(0);
2953
-                    if (! empty($qTrib)) {
2953
+                    if (!empty($qTrib)) {
2954 2954
                         $texto = number_format($qTrib->nodeValue, $this->qComCasasDec, ",", ".");
2955 2955
                         $this->pdf->textBox($x, $yTrib, $w7, $h, $texto, $aFont, 'T', $alinhamento, 0, '');
2956 2956
                     }
@@ -2963,7 +2963,7 @@  discard block
 block discarded – undo
2963 2963
                 // Valor Unitário Tributável
2964 2964
                 if ($mostrarUnidadeTributavel) {
2965 2965
                     $vUnTrib = $prod->getElementsByTagName("vUnTrib")->item(0);
2966
-                    if (! empty($vUnTrib)) {
2966
+                    if (!empty($vUnTrib)) {
2967 2967
                         $texto = number_format($vUnTrib->nodeValue, $this->vUnComCasasDec, ",", ".");
2968 2968
                         $this->pdf->textBox($x, $yTrib, $w8, $h, $texto, $aFont, 'T', $alinhamento, 0, '');
2969 2969
                     }
@@ -2977,7 +2977,7 @@  discard block
 block discarded – undo
2977 2977
                 $this->pdf->textBox($x, $y, $w9, $h, $texto, $aFont, 'T', $alinhamento, 0, '');
2978 2978
                 $x += $w9;
2979 2979
                 //Valor do Desconto
2980
-                $vdesc = ! empty($prod->getElementsByTagName("vDesc")->item(0)->nodeValue)
2980
+                $vdesc = !empty($prod->getElementsByTagName("vDesc")->item(0)->nodeValue)
2981 2981
                     ? $prod->getElementsByTagName("vDesc")->item(0)->nodeValue : 0;
2982 2982
 
2983 2983
                 $texto = number_format($vdesc, 2, ",", ".");
@@ -2985,7 +2985,7 @@  discard block
 block discarded – undo
2985 2985
                 //Valor da Base de calculo
2986 2986
                 $x += $w10;
2987 2987
                 if (isset($ICMS)) {
2988
-                    $texto = ! empty($ICMS->getElementsByTagName("vBC")->item(0)->nodeValue)
2988
+                    $texto = !empty($ICMS->getElementsByTagName("vBC")->item(0)->nodeValue)
2989 2989
                         ? number_format(
2990 2990
                             $ICMS->getElementsByTagName("vBC")->item(0)->nodeValue,
2991 2991
                             2,
@@ -2998,7 +2998,7 @@  discard block
 block discarded – undo
2998 2998
                 //Valor do ICMS
2999 2999
                 $x += $w11;
3000 3000
                 if (isset($ICMS)) {
3001
-                    $texto = ! empty($ICMS->getElementsByTagName("vICMS")->item(0)->nodeValue)
3001
+                    $texto = !empty($ICMS->getElementsByTagName("vICMS")->item(0)->nodeValue)
3002 3002
                         ? number_format(
3003 3003
                             $ICMS->getElementsByTagName("vICMS")->item(0)->nodeValue,
3004 3004
                             2,
@@ -3011,7 +3011,7 @@  discard block
 block discarded – undo
3011 3011
                 //Valor do IPI
3012 3012
                 $x += $w12;
3013 3013
                 if (isset($IPI)) {
3014
-                    $texto = ! empty($IPI->getElementsByTagName("vIPI")->item(0)->nodeValue)
3014
+                    $texto = !empty($IPI->getElementsByTagName("vIPI")->item(0)->nodeValue)
3015 3015
                         ? number_format(
3016 3016
                             $IPI->getElementsByTagName("vIPI")->item(0)->nodeValue,
3017 3017
                             2,
@@ -3026,7 +3026,7 @@  discard block
 block discarded – undo
3026 3026
                 // %ICMS
3027 3027
                 $x += $w13;
3028 3028
                 if (isset($ICMS)) {
3029
-                    $texto = ! empty($ICMS->getElementsByTagName("pICMS")->item(0)->nodeValue)
3029
+                    $texto = !empty($ICMS->getElementsByTagName("pICMS")->item(0)->nodeValue)
3030 3030
                         ? number_format(
3031 3031
                             $ICMS->getElementsByTagName("pICMS")->item(0)->nodeValue,
3032 3032
                             2,
@@ -3039,7 +3039,7 @@  discard block
 block discarded – undo
3039 3039
                 //%IPI
3040 3040
                 $x += $w14;
3041 3041
                 if (isset($IPI)) {
3042
-                    $texto = ! empty($IPI->getElementsByTagName("pIPI")->item(0)->nodeValue)
3042
+                    $texto = !empty($IPI->getElementsByTagName("pIPI")->item(0)->nodeValue)
3043 3043
                         ? number_format(
3044 3044
                             $IPI->getElementsByTagName("pIPI")->item(0)->nodeValue,
3045 3045
                             2,
@@ -3057,17 +3057,17 @@  discard block
 block discarded – undo
3057 3057
                 $veicProd = $prod->getElementsByTagName("veicProd")->item(0);
3058 3058
                 // Tag somente é gerada para veiculo 0k, e só é permitido um veiculo por NF-e por conta do detran
3059 3059
                 // Verifica se a Tag existe
3060
-                if (! empty($veicProd)) {
3060
+                if (!empty($veicProd)) {
3061 3061
                     $this->dadosItenVeiculoDANFE($oldX, $y, $nInicio, $h, $prod);
3062 3062
                 }
3063 3063
 
3064 3064
 
3065 3065
                 $y += $h;
3066
-                $i ++;
3066
+                $i++;
3067 3067
                 //incrementa o controle dos itens processados.
3068
-                $this->qtdeItensProc ++;
3068
+                $this->qtdeItensProc++;
3069 3069
             } else {
3070
-                $i ++;
3070
+                $i++;
3071 3071
             }
3072 3072
         }
3073 3073
 
@@ -3272,23 +3272,23 @@  discard block
 block discarded – undo
3272 3272
         $aFont = ['font' => $this->fontePadrao, 'size' => 7, 'style' => 'B'];
3273 3273
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
3274 3274
         //INSCRIÇÃO MUNICIPAL
3275
-        $y     += 3;
3275
+        $y += 3;
3276 3276
         $w     = round($this->wPrint * 0.23, 0);
3277 3277
         $texto = 'INSCRIÇÃO MUNICIPAL';
3278 3278
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
3279 3279
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
3280 3280
         //inscrição municipal
3281
-        $texto = ! empty($this->emit->getElementsByTagName("IM")->item(0)->nodeValue) ?
3281
+        $texto = !empty($this->emit->getElementsByTagName("IM")->item(0)->nodeValue) ?
3282 3282
             $this->emit->getElementsByTagName("IM")->item(0)->nodeValue : '';
3283 3283
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
3284 3284
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 0, '');
3285 3285
         //VALOR TOTAL DOS SERVIÇOS
3286
-        $x     += $w;
3286
+        $x += $w;
3287 3287
         $texto = 'VALOR TOTAL DOS SERVIÇOS';
3288 3288
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
3289 3289
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
3290 3290
         if (isset($this->ISSQNtot)) {
3291
-            $texto = ! empty($this->ISSQNtot->getElementsByTagName("vServ")->item(0)->nodeValue) ?
3291
+            $texto = !empty($this->ISSQNtot->getElementsByTagName("vServ")->item(0)->nodeValue) ?
3292 3292
                 $this->ISSQNtot->getElementsByTagName("vServ")->item(0)->nodeValue : '';
3293 3293
             $texto = number_format($texto, 2, ",", ".");
3294 3294
         } else {
@@ -3297,14 +3297,14 @@  discard block
 block discarded – undo
3297 3297
         $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
3298 3298
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'R', 0, '');
3299 3299
         //BASE DE CÁLCULO DO ISSQN
3300
-        $x     += $w;
3300
+        $x += $w;
3301 3301
         $texto = 'BASE DE CÁLCULO DO ISSQN';
3302 3302
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
3303 3303
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
3304 3304
         if (isset($this->ISSQNtot)) {
3305
-            $texto = ! empty($this->ISSQNtot->getElementsByTagName("vBC")->item(0)->nodeValue) ?
3305
+            $texto = !empty($this->ISSQNtot->getElementsByTagName("vBC")->item(0)->nodeValue) ?
3306 3306
                 $this->ISSQNtot->getElementsByTagName("vBC")->item(0)->nodeValue : '';
3307
-            $texto = ! empty($texto) ? number_format($texto, 2, ",", ".") : '';
3307
+            $texto = !empty($texto) ? number_format($texto, 2, ",", ".") : '';
3308 3308
         } else {
3309 3309
             $texto = '';
3310 3310
         }
@@ -3321,9 +3321,9 @@  discard block
 block discarded – undo
3321 3321
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
3322 3322
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
3323 3323
         if (isset($this->ISSQNtot)) {
3324
-            $texto = ! empty($this->ISSQNtot->getElementsByTagName("vISS")->item(0)->nodeValue) ?
3324
+            $texto = !empty($this->ISSQNtot->getElementsByTagName("vISS")->item(0)->nodeValue) ?
3325 3325
                 $this->ISSQNtot->getElementsByTagName("vISS")->item(0)->nodeValue : '';
3326
-            $texto = ! empty($texto) ? number_format($texto, 2, ",", ".") : '';
3326
+            $texto = !empty($texto) ? number_format($texto, 2, ",", ".") : '';
3327 3327
         } else {
3328 3328
             $texto = '';
3329 3329
         }
@@ -3362,7 +3362,7 @@  discard block
 block discarded – undo
3362 3362
 
3363 3363
         //INFORMAÇÕES COMPLEMENTARES
3364 3364
         $texto = "INFORMAÇÕES COMPLEMENTARES";
3365
-        $y     += 3;
3365
+        $y += 3;
3366 3366
         $w     = $this->wAdic;
3367 3367
         $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => 'B'];
3368 3368
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
@@ -3372,7 +3372,7 @@  discard block
 block discarded – undo
3372 3372
         //$this->textoAdic com o texto completo do campo
3373 3373
         //echo str_replace("\n", "<br>",$this->textoAdic);
3374 3374
         //die;
3375
-        $y     += 1;
3375
+        $y += 1;
3376 3376
         $aFont = ['font' => $this->fontePadrao, 'size' => $this->textadicfontsize * $this->pdf->k, 'style' => ''];
3377 3377
         //$aFont = ['font'=>$this->fontePadrao, 'size'=> 5, 'style'=>''];
3378 3378
         $this->pdf->textBox($x, $y + 2, $w - 2, $h, $this->textoAdic, $aFont, 'T', 'L', 0, '', false);
@@ -3417,7 +3417,7 @@  discard block
 block discarded – undo
3417 3417
                 $texto = "CONTINGÊNCIA SVC-RS\n" . $dhCont . "\n" . $xJust;
3418 3418
                 break;
3419 3419
         }
3420
-        $y     += 2;
3420
+        $y += 2;
3421 3421
         $aFont = ['font' => $this->fontePadrao, 'size' => 7, 'style' => ''];
3422 3422
         $this->pdf->textBox($x, $y, $w - 2, $h, $texto, $aFont, 'T', 'L', 0, '', false);
3423 3423
 
@@ -3472,7 +3472,7 @@  discard block
 block discarded – undo
3472 3472
         $tpNF = $this->ide->getElementsByTagName('tpNF')->item(0)->nodeValue;
3473 3473
         if ($tpNF == '0') {
3474 3474
             //NFe de Entrada
3475
-            $emitente     = '';
3475
+            $emitente = '';
3476 3476
             $emitente     .= $this->dest->getElementsByTagName("xNome")->item(0)->nodeValue . " - ";
3477 3477
             $emitente     .= $this->enderDest->getElementsByTagName("xLgr")->item(0)->nodeValue . ", ";
3478 3478
             $emitente     .= $this->enderDest->getElementsByTagName("nro")->item(0)->nodeValue . " - ";
@@ -3525,10 +3525,10 @@  discard block
 block discarded – undo
3525 3525
             $texto .= "AO LADO";
3526 3526
         }
3527 3527
         $texto .= ". EMISSÃO: ";
3528
-        $dEmi  = ! empty($this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue) ?
3528
+        $dEmi = !empty($this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue) ?
3529 3529
             $this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue : '';
3530 3530
         if ($dEmi == '') {
3531
-            $dEmi  = ! empty($this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue) ?
3531
+            $dEmi  = !empty($this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue) ?
3532 3532
                 $this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue : '';
3533 3533
             $aDemi = explode('T', $dEmi);
3534 3534
             $dEmi  = $aDemi[0];
@@ -3551,12 +3551,12 @@  discard block
 block discarded – undo
3551 3551
             $this->pdf->textBox($x1, $y, $w1, 18, $texto, $aFont, 'C', 'C', 1, '');
3552 3552
             //DATA DE RECEBIMENTO
3553 3553
             $texto = "DATA DE RECEBIMENTO";
3554
-            $y     += $h;
3554
+            $y += $h;
3555 3555
             $w2    = round($this->wPrint * 0.17, 0); //35;
3556 3556
             $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
3557 3557
             $this->pdf->textBox($x, $y, $w2, 8, $texto, $aFont, 'T', 'L', 1, '');
3558 3558
             //IDENTIFICAÇÃO E ASSINATURA DO RECEBEDOR
3559
-            $x     += $w2;
3559
+            $x += $w2;
3560 3560
             $w3    = $w - $w2;
3561 3561
             $texto = "IDENTIFICAÇÃO E ASSINATURA DO RECEBEDOR";
3562 3562
             $this->pdf->textBox($x, $y, $w3, 8, $texto, $aFont, 'T', 'L', 1, '');
@@ -3567,7 +3567,7 @@  discard block
 block discarded – undo
3567 3567
 
3568 3568
             return $y;
3569 3569
         } else {
3570
-            $x --;
3570
+            $x--;
3571 3571
             $x = $this->pdf->textBox90($x, $y, $w - 1, $h, $texto, $aFontSmall, 'C', 'L', 0, '', false);
3572 3572
             //NUMERO DA NOTA FISCAL LOGO NFE
3573 3573
             $w1    = 18;
@@ -3588,7 +3588,7 @@  discard block
 block discarded – undo
3588 3588
             $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
3589 3589
             $this->pdf->textBox90($x, $y, $w2, 8, $texto, $aFont, 'T', 'L', 1, '');
3590 3590
             //IDENTIFICAÇÃO E ASSINATURA DO RECEBEDOR
3591
-            $y     -= $w2;
3591
+            $y -= $w2;
3592 3592
             $w3    = $w - $w2;
3593 3593
             $texto = "IDENTIFICAÇÃO E ASSINATURA DO RECEBEDOR";
3594 3594
             $aFont = ['font' => $this->fontePadrao, 'size' => 5.7, 'style' => ''];
@@ -3609,18 +3609,18 @@  discard block
 block discarded – undo
3609 3609
      */
3610 3610
     protected function geraInformacoesDaTagCompra()
3611 3611
     {
3612
-        if (! $this->gerarInformacoesAutomaticas) {
3612
+        if (!$this->gerarInformacoesAutomaticas) {
3613 3613
             return '';
3614 3614
         }
3615 3615
         $saida = "";
3616 3616
         if (isset($this->compra)) {
3617
-            if (! empty($this->compra->getElementsByTagName("xNEmp")->item(0)->nodeValue)) {
3617
+            if (!empty($this->compra->getElementsByTagName("xNEmp")->item(0)->nodeValue)) {
3618 3618
                 $saida .= " Nota de Empenho: " . $this->compra->getElementsByTagName("xNEmp")->item(0)->nodeValue;
3619 3619
             }
3620
-            if (! empty($this->compra->getElementsByTagName("xPed")->item(0)->nodeValue)) {
3620
+            if (!empty($this->compra->getElementsByTagName("xPed")->item(0)->nodeValue)) {
3621 3621
                 $saida .= " Pedido: " . $this->compra->getElementsByTagName("xPed")->item(0)->nodeValue;
3622 3622
             }
3623
-            if (! empty($this->compra->getElementsByTagName("xCont")->item(0)->nodeValue)) {
3623
+            if (!empty($this->compra->getElementsByTagName("xCont")->item(0)->nodeValue)) {
3624 3624
                 $saida .= " Contrato: " . $this->compra->getElementsByTagName("xCont")->item(0)->nodeValue;
3625 3625
             }
3626 3626
         }
@@ -3651,10 +3651,10 @@  discard block
 block discarded – undo
3651 3651
         if ($icmss > 0) {
3652 3652
             $icmss = 1;
3653 3653
         }
3654
-        $dEmi = ! empty($this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue) ?
3654
+        $dEmi = !empty($this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue) ?
3655 3655
             $this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue : '';
3656 3656
         if ($dEmi == '') {
3657
-            $dEmi  = ! empty($this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue) ?
3657
+            $dEmi  = !empty($this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue) ?
3658 3658
                 $this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue : '';
3659 3659
             $aDemi = explode('T', $dEmi);
3660 3660
             $dEmi  = $aDemi[0];
@@ -3678,7 +3678,7 @@  discard block
 block discarded – undo
3678 3678
      */
3679 3679
     protected function geraInformacoesDasNotasReferenciadas()
3680 3680
     {
3681
-        if (! $this->gerarInformacoesAutomaticas) {
3681
+        if (!$this->gerarInformacoesAutomaticas) {
3682 3682
             return '';
3683 3683
         }
3684 3684
         $formaNfeRef = "\r\nNFe Ref.: série:%d número:%d emit:%s em %s [%s]";
@@ -3706,7 +3706,7 @@  discard block
 block discarded – undo
3706 3706
                 $cnpj          = $this->formatField(substr($chave_acesso, 6, 14), "##.###.###/####-##");
3707 3707
                 $serie         = substr($chave_acesso, 22, 3);
3708 3708
                 $numero        = substr($chave_acesso, 25, 9);
3709
-                $saida         .= sprintf($formaNfeRef, $serie, $numero, $cnpj, $data, $chave_acessoF);
3709
+                $saida .= sprintf($formaNfeRef, $serie, $numero, $cnpj, $data, $chave_acessoF);
3710 3710
             }
3711 3711
             $refNF = $nfRef->getElementsByTagName('refNF');
3712 3712
             foreach ($refNF as $umaRefNFe) {
@@ -3717,7 +3717,7 @@  discard block
 block discarded – undo
3717 3717
                 $numero = $umaRefNFe->getElementsByTagName('nNF')->item(0)->nodeValue;
3718 3718
                 $data   = substr($data, 2, 2) . "/20" . substr($data, 0, 2);
3719 3719
                 $cnpj   = $this->formatField($cnpj, "##.###.###/####-##");
3720
-                $saida  .= sprintf($formaNfRef, $serie, $numero, $cnpj, $data, $mod);
3720
+                $saida .= sprintf($formaNfRef, $serie, $numero, $cnpj, $data, $mod);
3721 3721
             }
3722 3722
             $refCTe = $nfRef->getElementsByTagName('refCTe');
3723 3723
             foreach ($refCTe as $chave_acessoRef) {
@@ -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($formaCTeRef, $serie, $numero, $cnpj, $data, $chave_acessoF);
3730
+                $saida .= sprintf($formaCTeRef, $serie, $numero, $cnpj, $data, $chave_acessoF);
3731 3731
             }
3732 3732
             $refECF = $nfRef->getElementsByTagName('refECF');
3733 3733
             foreach ($refECF as $umaRefNFe) {
@@ -3739,10 +3739,9 @@  discard block
 block discarded – undo
3739 3739
             $refNFP = $nfRef->getElementsByTagName('refNFP');
3740 3740
             foreach ($refNFP as $umaRefNFe) {
3741 3741
                 $data   = $umaRefNFe->getElementsByTagName('AAMM')->item(0)->nodeValue;
3742
-                $cnpj   = ! empty($umaRefNFe->getElementsByTagName('CNPJ')->item(0)->nodeValue) ?
3743
-                    $umaRefNFe->getElementsByTagName('CNPJ')->item(0)->nodeValue :
3744
-                    '';
3745
-                $cpf    = ! empty($umaRefNFe->getElementsByTagName('CPF')->item(0)->nodeValue) ?
3742
+                $cnpj   = !empty($umaRefNFe->getElementsByTagName('CNPJ')->item(0)->nodeValue) ?
3743
+                    $umaRefNFe->getElementsByTagName('CNPJ')->item(0)->nodeValue : '';
3744
+                $cpf    = !empty($umaRefNFe->getElementsByTagName('CPF')->item(0)->nodeValue) ?
3746 3745
                     $umaRefNFe->getElementsByTagName('CPF')->item(0)->nodeValue : '';
3747 3746
                 $mod    = $umaRefNFe->getElementsByTagName('mod')->item(0)->nodeValue;
3748 3747
                 $serie  = $umaRefNFe->getElementsByTagName('serie')->item(0)->nodeValue;
@@ -3764,7 +3763,7 @@  discard block
 block discarded – undo
3764 3763
     private function loadDoc($xml)
3765 3764
     {
3766 3765
         $this->xml = $xml;
3767
-        if (! empty($xml)) {
3766
+        if (!empty($xml)) {
3768 3767
             $this->dom = new Dom();
3769 3768
             $this->dom->loadXML($this->xml);
3770 3769
             if (empty($this->dom->getElementsByTagName("infNFe")->item(0))) {
@@ -3818,7 +3817,7 @@  discard block
 block discarded – undo
3818 3817
         $numlinhas    = $this->pdf->getNumLines($textoProduto, $w2, $aFont);
3819 3818
 
3820 3819
         if ($mostrarUnidadeTributavel && $numlinhas == 1) {
3821
-            $numlinhas ++;
3820
+            $numlinhas++;
3822 3821
         }
3823 3822
 
3824 3823
         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
@@ -27,8 +27,8 @@  discard block
 block discarded – undo
27 27
     protected $paperwidth = 80;
28 28
     protected $descPercent = 0.38;
29 29
     protected $xml; // string XML NFe
30
-    protected $logomarca=''; // path para logomarca em jpg
31
-    protected $formatoChave="#### #### #### #### #### #### #### #### #### #### ####";
30
+    protected $logomarca = ''; // path para logomarca em jpg
31
+    protected $formatoChave = "#### #### #### #### #### #### #### #### #### #### ####";
32 32
     protected $nfeProc;
33 33
     protected $nfe;
34 34
     protected $infNFe;
@@ -221,10 +221,10 @@  discard block
 block discarded – undo
221 221
         //total inicial de paginas
222 222
         $totPag = 1;
223 223
         //largura imprimivel em mm: largura da folha menos as margens esq/direita
224
-        $this->wPrint = $maxW-($margEsq*2);
224
+        $this->wPrint = $maxW - ($margEsq * 2);
225 225
         //comprimento (altura) imprimivel em mm: altura da folha menos as margens
226 226
         //superior e inferior
227
-        $this->hPrint = $maxH-$margSup-$margInf;
227
+        $this->hPrint = $maxH - $margSup - $margInf;
228 228
         // estabelece contagem de paginas
229 229
         $this->pdf->aliasNbPages();
230 230
         $this->pdf->setMargins($margEsq, $margSup); // fixa as margens
@@ -248,7 +248,7 @@  discard block
 block discarded – undo
248 248
         $y = $this->blocoIX($y); //informações complementares e sobre tributos
249 249
         $y = $this->blocoX($y); //creditos
250 250
         
251
-        $ymark = $maxH/4;
251
+        $ymark = $maxH / 4;
252 252
         if ($this->tpAmb == 2) {
253 253
             $this->pdf->setTextColor(120, 120, 120);
254 254
             $texto = "SEM VALOR FISCAL\nEmitida em ambiente de homologacao";
@@ -257,7 +257,7 @@  discard block
 block discarded – undo
257 257
                 $this->margem,
258 258
                 $ymark,
259 259
                 $this->wPrint,
260
-                $maxH/2,
260
+                $maxH / 2,
261 261
                 $texto,
262 262
                 $aFont,
263 263
                 'T',
@@ -274,9 +274,9 @@  discard block
 block discarded – undo
274 274
             $aFont = ['font' => $this->fontePadrao, 'size' => 24, 'style' => 'B'];
275 275
             $this->pdf->textBox(
276 276
                 $this->margem,
277
-                $ymark+4,
277
+                $ymark + 4,
278 278
                 $this->wPrint,
279
-                $maxH/2,
279
+                $maxH / 2,
280 280
                 $texto,
281 281
                 $aFont,
282 282
                 'T',
@@ -288,9 +288,9 @@  discard block
 block discarded – undo
288 288
             $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
289 289
             $this->pdf->textBox(
290 290
                 $this->margem,
291
-                $ymark+14,
291
+                $ymark + 14,
292 292
                 $this->wPrint,
293
-                $maxH/2,
293
+                $maxH / 2,
294 294
                 $this->submessage,
295 295
                 $aFont,
296 296
                 'T',
@@ -318,7 +318,7 @@  discard block
 block discarded – undo
318 318
             $y = $this->blocoVIII($y); //QRCODE
319 319
             $y = $this->blocoIX($y); //informações sobre tributos
320 320
             $y = $this->blocoX($y); //creditos
321
-            $ymark = $maxH/4;
321
+            $ymark = $maxH / 4;
322 322
             if ($this->tpAmb == 2) {
323 323
                 $this->pdf->setTextColor(120, 120, 120);
324 324
                 $texto = "SEM VALOR FISCAL\nEmitida em ambiente de homologacao";
@@ -327,7 +327,7 @@  discard block
 block discarded – undo
327 327
                     $this->margem,
328 328
                     $ymark,
329 329
                     $this->wPrint,
330
-                    $maxH/2,
330
+                    $maxH / 2,
331 331
                     $texto,
332 332
                     $aFont,
333 333
                     'T',
@@ -413,7 +413,7 @@  discard block
 block discarded – undo
413 413
             } elseif (!empty($retEvento = $this->nfeProc->getElementsByTagName('retEvento')->item(0))) {
414 414
                 $infEvento = $retEvento->getElementsByTagName('infEvento')->item(0);
415 415
                 $cStat = $this->getTagValue($infEvento, "cStat");
416
-                $tpEvento= $this->getTagValue($infEvento, "tpEvento");
416
+                $tpEvento = $this->getTagValue($infEvento, "tpEvento");
417 417
                 $dhEvento = date(
418 418
                     "d/m/Y H:i:s",
419 419
                     $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.