Passed
Pull Request — master (#335)
by Roberto
06:25
created
src/BPe/Dabpe.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -15,7 +15,6 @@
 block discarded – undo
15 15
  */
16 16
 
17 17
 use \Exception;
18
-use InvalidArgumentException;
19 18
 use NFePHP\DA\Legacy\Dom;
20 19
 use NFePHP\DA\Legacy\Pdf;
21 20
 use NFePHP\DA\Common\DaCommon;
Please login to merge, or discard this patch.
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -378,12 +378,12 @@  discard block
 block discarded – undo
378 378
         $this->pdf->setLineWidth(0.1); // define a largura da linha
379 379
         $this->pdf->setTextColor(0, 0, 0);
380 380
         $this->pdf->textBox(0, 0, $maxW, $maxH); // POR QUE PRECISO DESA LINHA?
381
-        $hcabecalho = 16;//para cabeçalho (dados emitente mais logomarca)  (FIXO)
381
+        $hcabecalho = 16; //para cabeçalho (dados emitente mais logomarca)  (FIXO)
382 382
         if (strlen($this->getTagValue($this->emit, "xNome")) > 40) {
383 383
             $hcabecalho += 2;
384 384
             $tamPapelVert += 2;
385 385
         };
386
-        $hcabecalhoSecundario = 18;//para cabeçalho secundário (cabeçalho sefaz) (FIXO)
386
+        $hcabecalhoSecundario = 18; //para cabeçalho secundário (cabeçalho sefaz) (FIXO)
387 387
         $hagencia = 0;
388 388
         if (!empty($this->agencia)) {
389 389
             if (strlen($this->getTagValue($this->agencia, "xNome")) > 39) {
@@ -393,9 +393,9 @@  discard block
 block discarded – undo
393 393
             $hagencia += 20;
394 394
             $tamPapelVert += 18;
395 395
         }
396
-        $hprodutos = $hLinha + ($qtdItens * $hLinha);//box poduto
396
+        $hprodutos = $hLinha + ($qtdItens * $hLinha); //box poduto
397 397
         $hTotal = 12; //box total (FIXO)
398
-        $hpagamentos = (2 * $hLinha) + ($qtdPgto * $hLinha);//para pagamentos
398
+        $hpagamentos = (2 * $hLinha) + ($qtdPgto * $hLinha); //para pagamentos
399 399
         if (!empty($this->vTroco)) {
400 400
             $hpagamentos += $hLinha;
401 401
         }
@@ -445,9 +445,9 @@  discard block
 block discarded – undo
445 445
         }
446 446
         //creditos do integrador
447 447
         $aFont = array('font' => $this->fontePadrao, 'size' => 6, 'style' => 'I');
448
-        $this->pdf->textBox($x, $this->hPrint-1, $this->wPrint, 3, $this->creditos, $aFont, 'T', 'L', false, '', false);
448
+        $this->pdf->textBox($x, $this->hPrint - 1, $this->wPrint, 3, $this->creditos, $aFont, 'T', 'L', false, '', false);
449 449
         $texto = "Powered by NFePHP®";
450
-        $this->pdf->textBox($x, $this->hPrint-1, $this->wPrint, 0, $texto, $aFont, 'T', 'R', false, '');
450
+        $this->pdf->textBox($x, $this->hPrint - 1, $this->wPrint, 0, $texto, $aFont, 'T', 'R', false, '');
451 451
     }
452 452
 
453 453
     /**
@@ -548,13 +548,13 @@  discard block
 block discarded – undo
548 548
         if (!empty($this->logomarca)) {
549 549
             $xImg = $margemInterna;
550 550
             $logoInfo = getimagesize($this->logomarca);
551
-            $logoWmm = ($logoInfo[0]/72)*25.4;
552
-            $logoHmm = ($logoInfo[1]/72)*25.4;
553
-            $nImgW = $this->paperwidth/2 - ($this->paperwidth/10 + 4);
554
-            $nImgH = round($logoHmm * ($nImgW/$logoWmm), 0);
551
+            $logoWmm = ($logoInfo[0] / 72) * 25.4;
552
+            $logoHmm = ($logoInfo[1] / 72) * 25.4;
553
+            $nImgW = $this->paperwidth / 2 - ($this->paperwidth / 10 + 4);
554
+            $nImgH = round($logoHmm * ($nImgW / $logoWmm), 0);
555 555
             if ($nImgH > 18) {
556 556
                 $nImgH = 18;
557
-                $nImgW = round($logoWmm * ($nImgH/$logoHmm), 0);
557
+                $nImgW = round($logoWmm * ($nImgH / $logoHmm), 0);
558 558
             }
559 559
             $yImg = 15;
560 560
             $this->pdf->image($this->logomarca, $xImg, $yImg, $nImgW, $nImgH, 'jpeg');
Please login to merge, or discard this patch.
src/CTe/Dacte.php 2 patches
Doc Comments   +45 added lines, -46 removed lines patch added patch discarded remove patch
@@ -94,6 +94,9 @@  discard block
 block discarded – undo
94 94
         $this->loadDoc($xml);
95 95
     }
96 96
 
97
+    /**
98
+     * @param string $xml
99
+     */
97 100
     private function loadDoc($xml)
98 101
     {
99 102
         $this->xml = $xml;
@@ -204,10 +207,6 @@  discard block
 block discarded – undo
204 207
      * A definição de margens e posições iniciais para a impressão são estabelecidas no
205 208
      * pelo conteúdo da funçao e podem ser modificados.
206 209
      *
207
-     * @param  string $orientacao (Opcional) Estabelece a orientação da
208
-     *                impressão (ex. P-retrato), se nada for fornecido será
209
-     *                usado o padrão da NFe
210
-     * @param  string $papel (Opcional) Estabelece o tamanho do papel (ex. A4)
211 210
      * @return string O ID da NFe numero de 44 digitos extraido do arquivo XML
212 211
      */
213 212
     protected function monta(
@@ -412,8 +411,8 @@  discard block
 block discarded – undo
412 411
      * cabecalho
413 412
      * Monta o cabelhalho da DACTE ( retrato e paisagem )
414 413
      *
415
-     * @param  number $x Posição horizontal inicial, canto esquerdo
416
-     * @param  number $y Posição vertical inicial, canto superior
414
+     * @param  integer $x Posição horizontal inicial, canto esquerdo
415
+     * @param  integer $y Posição vertical inicial, canto superior
417 416
      * @param  number $pag Número da Página
418 417
      * @param  number $totPag Total de páginas
419 418
      * @return number Posição vertical final
@@ -1067,8 +1066,7 @@  discard block
 block discarded – undo
1067 1066
      * rodapeDACTE
1068 1067
      * Monta o rodape no final da DACTE ( retrato e paisagem )
1069 1068
      *
1070
-     * @param number $xInic Posição horizontal canto esquerdo
1071
-     * @param number $yFinal Posição vertical final para impressão
1069
+     * @param integer $x
1072 1070
      */
1073 1071
     protected function rodape($x, $y)
1074 1072
     {
@@ -1091,8 +1089,8 @@  discard block
 block discarded – undo
1091 1089
      * remetente
1092 1090
      * Monta o campo com os dados do remetente na DACTE. ( retrato  e paisagem  )
1093 1091
      *
1094
-     * @param  number $x Posição horizontal canto esquerdo
1095
-     * @param  number $y Posição vertical canto superior
1092
+     * @param  integer $x Posição horizontal canto esquerdo
1093
+     * @param  integer $y Posição vertical canto superior
1096 1094
      * @return number Posição vertical final
1097 1095
      */
1098 1096
     protected function remetente($x = 0, $y = 0)
@@ -1179,8 +1177,8 @@  discard block
 block discarded – undo
1179 1177
      * destinatario
1180 1178
      * Monta o campo com os dados do destinatário na DACTE.
1181 1179
      *
1182
-     * @param  number $x Posição horizontal canto esquerdo
1183
-     * @param  number $y Posição vertical canto superior
1180
+     * @param  integer $x Posição horizontal canto esquerdo
1181
+     * @param  integer $y Posição vertical canto superior
1184 1182
      * @return number Posição vertical final
1185 1183
      */
1186 1184
     protected function destinatario($x = 0, $y = 0)
@@ -1266,8 +1264,8 @@  discard block
 block discarded – undo
1266 1264
      * expedidor
1267 1265
      * Monta o campo com os dados do remetente na DACTE. ( retrato  e paisagem  )
1268 1266
      *
1269
-     * @param  number $x Posição horizontal canto esquerdo
1270
-     * @param  number $y Posição vertical canto superior
1267
+     * @param  integer $x Posição horizontal canto esquerdo
1268
+     * @param  integer $y Posição vertical canto superior
1271 1269
      * @return number Posição vertical final
1272 1270
      */
1273 1271
     protected function expedidor($x = 0, $y = 0)
@@ -1363,8 +1361,8 @@  discard block
 block discarded – undo
1363 1361
      * recebedor
1364 1362
      * Monta o campo com os dados do remetente na DACTE. ( retrato  e paisagem  )
1365 1363
      *
1366
-     * @param  number $x Posição horizontal canto esquerdo
1367
-     * @param  number $y Posição vertical canto superior
1364
+     * @param  integer $x Posição horizontal canto esquerdo
1365
+     * @param  integer $y Posição vertical canto superior
1368 1366
      * @return number Posição vertical final
1369 1367
      */
1370 1368
     protected function recebedor($x = 0, $y = 0)
@@ -1460,8 +1458,8 @@  discard block
 block discarded – undo
1460 1458
      * tomador
1461 1459
      * Monta o campo com os dados do remetente na DACTE. ( retrato  e paisagem  )
1462 1460
      *
1463
-     * @param  number $x Posição horizontal canto esquerdo
1464
-     * @param  number $y Posição vertical canto superior
1461
+     * @param  integer $x Posição horizontal canto esquerdo
1462
+     * @param  integer $y Posição vertical canto superior
1465 1463
      * @return number Posição vertical final
1466 1464
      */
1467 1465
     protected function tomador($x = 0, $y = 0)
@@ -1549,8 +1547,8 @@  discard block
 block discarded – undo
1549 1547
      * descricaoCarga
1550 1548
      * Monta o campo com os dados do remetente na DACTE. ( retrato  e paisagem  )
1551 1549
      *
1552
-     * @param  number $x Posição horizontal canto esquerdo
1553
-     * @param  number $y Posição vertical canto superior
1550
+     * @param  integer $x Posição horizontal canto esquerdo
1551
+     * @param  integer $y Posição vertical canto superior
1554 1552
      * @return number Posição vertical final
1555 1553
      */
1556 1554
     protected function descricaoCarga($x = 0, $y = 0)
@@ -1726,8 +1724,8 @@  discard block
 block discarded – undo
1726 1724
      * compValorServ
1727 1725
      * Monta o campo com os componentes da prestação de serviços.
1728 1726
      *
1729
-     * @param  number $x Posição horizontal canto esquerdo
1730
-     * @param  number $y Posição vertical canto superior
1727
+     * @param  integer $x Posição horizontal canto esquerdo
1728
+     * @param  integer $y Posição vertical canto superior
1731 1729
      * @return number Posição vertical final
1732 1730
      */
1733 1731
     protected function compValorServ($x = 0, $y = 0)
@@ -1825,8 +1823,8 @@  discard block
 block discarded – undo
1825 1823
      * impostos
1826 1824
      * Monta o campo com os dados do remetente na DACTE. ( retrato  e paisagem  )
1827 1825
      *
1828
-     * @param  number $x Posição horizontal canto esquerdo
1829
-     * @param  number $y Posição vertical canto superior
1826
+     * @param  integer $x Posição horizontal canto esquerdo
1827
+     * @param  integer $y Posição vertical canto superior
1830 1828
      * @return number Posição vertical final
1831 1829
      */
1832 1830
     protected function impostos($x = 0, $y = 0)
@@ -2043,8 +2041,8 @@  discard block
 block discarded – undo
2043 2041
      * docOrig
2044 2042
      * Monta o campo com os documentos originarios.
2045 2043
      *
2046
-     * @param  number $x Posição horizontal canto esquerdo
2047
-     * @param  number $y Posição vertical canto superior
2044
+     * @param  integer $x Posição horizontal canto esquerdo
2045
+     * @param  integer $y Posição vertical canto superior
2048 2046
      * @return number Posição vertical final
2049 2047
      */
2050 2048
     protected function docOrig($x = 0, $y = 0)
@@ -2339,8 +2337,8 @@  discard block
 block discarded – undo
2339 2337
      * docOrigContinuacao
2340 2338
      * Monta o campo com os documentos originarios.
2341 2339
      *
2342
-     * @param  number $x Posição horizontal canto esquerdo
2343
-     * @param  number $y Posição vertical canto superior
2340
+     * @param  integer $x Posição horizontal canto esquerdo
2341
+     * @param  integer $y Posição vertical canto superior
2344 2342
      * @return number Posição vertical final
2345 2343
      */
2346 2344
     protected function docOrigContinuacao($x = 0, $y = 0)
@@ -2460,8 +2458,8 @@  discard block
 block discarded – undo
2460 2458
      * docCompl
2461 2459
      * Monta o campo com os dados do remetente na DACTE.
2462 2460
      *
2463
-     * @param number $x Posição horizontal canto esquerdo
2464
-     * @param number $y Posição vertical canto superior
2461
+     * @param integer $x Posição horizontal canto esquerdo
2462
+     * @param integer $y Posição vertical canto superior
2465 2463
      * @return number Posição vertical final
2466 2464
      */
2467 2465
     protected function docCompl($x = 0, $y = 0)
@@ -2529,8 +2527,8 @@  discard block
 block discarded – undo
2529 2527
      * observacao
2530 2528
      * Monta o campo com os dados do remetente na DACTE.
2531 2529
      *
2532
-     * @param  number $x Posição horizontal canto esquerdo
2533
-     * @param  number $y Posição vertical canto superior
2530
+     * @param  integer $x Posição horizontal canto esquerdo
2531
+     * @param  integer $y Posição vertical canto superior
2534 2532
      * @return number Posição vertical final
2535 2533
      */
2536 2534
     protected function observacao($x = 0, $y = 0)
@@ -2572,8 +2570,8 @@  discard block
 block discarded – undo
2572 2570
      * modalRod
2573 2571
      * Monta o campo com os dados do remetente na DACTE. ( retrato  e paisagem  )
2574 2572
      *
2575
-     * @param  number $x Posição horizontal canto esquerdo
2576
-     * @param  number $y Posição vertical canto superior
2573
+     * @param  integer $x Posição horizontal canto esquerdo
2574
+     * @param  integer $y Posição vertical canto superior
2577 2575
      * @return number Posição vertical final
2578 2576
      */
2579 2577
     protected function modalRod($x = 0, $y = 0)
@@ -2613,8 +2611,8 @@  discard block
 block discarded – undo
2613 2611
      * modalAereo
2614 2612
      * Monta o campo com os dados do remetente na DACTE. ( retrato  e paisagem  )
2615 2613
      *
2616
-     * @param  number $x Posição horizontal canto esquerdo
2617
-     * @param  number $y Posição vertical canto superior
2614
+     * @param  integer $x Posição horizontal canto esquerdo
2615
+     * @param  integer $y Posição vertical canto superior
2618 2616
      * @return number Posição vertical final
2619 2617
      */
2620 2618
     protected function modalAereo($x = 0, $y = 0)
@@ -2670,8 +2668,8 @@  discard block
 block discarded – undo
2670 2668
      * modalAquaviario
2671 2669
      * Monta o campo com os dados do remetente na DACTE. ( retrato  e paisagem  )
2672 2670
      *
2673
-     * @param  number $x Posição horizontal canto esquerdo
2674
-     * @param  number $y Posição vertical canto superior
2671
+     * @param  integer $x Posição horizontal canto esquerdo
2672
+     * @param  integer $y Posição vertical canto superior
2675 2673
      * @return number Posição vertical final
2676 2674
      */
2677 2675
     protected function modalAquaviario($x = 0, $y = 0)
@@ -2839,8 +2837,8 @@  discard block
 block discarded – undo
2839 2837
      * modalFerr
2840 2838
      * Monta o campo com os dados do remetente na DACTE. ( retrato  e paisagem  )
2841 2839
      *
2842
-     * @param  number $x Posição horizontal canto esquerdo
2843
-     * @param  number $y Posição vertical canto superior
2840
+     * @param  integer $x Posição horizontal canto esquerdo
2841
+     * @param  integer $y Posição vertical canto superior
2844 2842
      * @return number Posição vertical final
2845 2843
      */
2846 2844
     protected function modalFerr($x = 0, $y = 0)
@@ -3117,8 +3115,8 @@  discard block
 block discarded – undo
3117 3115
      * canhoto
3118 3116
      * Monta o campo com os dados do remetente na DACTE.
3119 3117
      *
3120
-     * @param  number $x Posição horizontal canto esquerdo
3121
-     * @param  number $y Posição vertical canto superior
3118
+     * @param  integer $x Posição horizontal canto esquerdo
3119
+     * @param  integer $y Posição vertical canto superior
3122 3120
      * @return number Posição vertical final
3123 3121
      */
3124 3122
     protected function canhoto($x = 0, $y = 0)
@@ -3191,9 +3189,10 @@  discard block
 block discarded – undo
3191 3189
      * dadosAdic
3192 3190
      * Coloca o grupo de dados adicionais da DACTE.
3193 3191
      *
3194
-     * @param  number $x Posição horizontal canto esquerdo
3195
-     * @param  number $y Posição vertical canto superior
3196
-     * @param  number $h altura do campo
3192
+     * @param  integer $x Posição horizontal canto esquerdo
3193
+     * @param  double $y Posição vertical canto superior
3194
+     * @param  integer $h altura do campo
3195
+     * @param integer $pag
3197 3196
      * @return number Posição vertical final
3198 3197
      */
3199 3198
     protected function dadosAdic($x, $y, $pag, $h)
@@ -3386,7 +3385,7 @@  discard block
 block discarded – undo
3386 3385
      * Fornece a imformação multiplicação de peso contida na CTe
3387 3386
      *
3388 3387
      * @param  interger $U Informação de peso extraida da CTe
3389
-     * @return interger
3388
+     * @return integer
3390 3389
      */
3391 3390
     protected function multiUniPeso($U = '')
3392 3391
     {
Please login to merge, or discard this patch.
Spacing   +8 added lines, -10 removed lines patch added patch discarded remove patch
@@ -1079,7 +1079,7 @@  discard block
 block discarded – undo
1079 1079
             'size' => 6,
1080 1080
             'style' => '');
1081 1081
         $this->pdf->textBox($x, $y, $w, 4, $texto, $aFont, 'T', 'L', 0, '');
1082
-        $texto = $this->creditos .  "  Powered by NFePHP®";
1082
+        $texto = $this->creditos . "  Powered by NFePHP®";
1083 1083
         $aFont = array(
1084 1084
             'font' => $this->fontePadrao,
1085 1085
             'size' => 6,
@@ -1112,7 +1112,7 @@  discard block
 block discarded – undo
1112 1112
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', true, '');
1113 1113
         $aFont = $this->formatNegrito;
1114 1114
         $texto = $this->getTagValue($this->rem, "xNome");
1115
-        $this->pdf->textBox($x1, $y, $w-18, $h, $texto, $aFont, 'T', 'L', false, '', true);
1115
+        $this->pdf->textBox($x1, $y, $w - 18, $h, $texto, $aFont, 'T', 'L', false, '', true);
1116 1116
         $y += 3;
1117 1117
         $texto = 'ENDEREÇO';
1118 1118
         $aFont = $this->formatPadrao;
@@ -1200,7 +1200,7 @@  discard block
 block discarded – undo
1200 1200
         $this->pdf->textBox($x - 0.5, $y, $w, $h, $texto, $aFont, 'T', 'L', true, '');
1201 1201
         $aFont = $this->formatNegrito;
1202 1202
         $texto = $this->getTagValue($this->dest, "xNome");
1203
-        $this->pdf->textBox($x1, $y, $w-18, $h, $texto, $aFont, 'T', 'L', false, '', true);
1203
+        $this->pdf->textBox($x1, $y, $w - 18, $h, $texto, $aFont, 'T', 'L', false, '', true);
1204 1204
         $y += 3;
1205 1205
         $texto = 'ENDEREÇO';
1206 1206
         $aFont = $this->formatPadrao;
@@ -1297,8 +1297,7 @@  discard block
 block discarded – undo
1297 1297
             $texto = $this->getTagValue($this->enderExped, "xLgr") . ', ';
1298 1298
             $texto .= $this->getTagValue($this->enderExped, "nro");
1299 1299
             $texto .= $this->getTagValue($this->enderExped, "xCpl") != "" ?
1300
-                ' - ' . $this->getTagValue($this->enderExped, "xCpl") :
1301
-                '';
1300
+                ' - ' . $this->getTagValue($this->enderExped, "xCpl") : '';
1302 1301
         } else {
1303 1302
             $texto = '';
1304 1303
         }
@@ -1394,8 +1393,7 @@  discard block
 block discarded – undo
1394 1393
             $texto = $this->getTagValue($this->enderReceb, "xLgr") . ', ';
1395 1394
             $texto .= $this->getTagValue($this->enderReceb, "nro");
1396 1395
             $texto .= ($this->getTagValue($this->enderReceb, "xCpl") != "") ?
1397
-                ' - ' . $this->getTagValue($this->enderReceb, "xCpl") :
1398
-                '';
1396
+                ' - ' . $this->getTagValue($this->enderReceb, "xCpl") : '';
1399 1397
         } else {
1400 1398
             $texto = '';
1401 1399
         }
@@ -1599,7 +1597,7 @@  discard block
 block discarded – undo
1599 1597
         $qCarga = 0;
1600 1598
         foreach ($this->infQ as $infQ) {
1601 1599
             if (in_array($this->getTagValue($infQ, "cUnid"), array('01', '02'))) {
1602
-                $qCarga += (float)$this->getTagValue($infQ, "qCarga");
1600
+                $qCarga += (float) $this->getTagValue($infQ, "qCarga");
1603 1601
             }
1604 1602
         }
1605 1603
         $texto = 'PESO BRUTO (KG)';
@@ -1650,7 +1648,7 @@  discard block
 block discarded – undo
1650 1648
         $qCarga = 0;
1651 1649
         foreach ($this->infQ as $infQ) {
1652 1650
             if ($this->getTagValue($infQ, "cUnid") == '00') {
1653
-                $qCarga += (float)$this->getTagValue($infQ, "qCarga");
1651
+                $qCarga += (float) $this->getTagValue($infQ, "qCarga");
1654 1652
             }
1655 1653
         }
1656 1654
         $texto = !empty($qCarga) ? number_format($qCarga, 3, ",", ".") : '';
@@ -1667,7 +1665,7 @@  discard block
 block discarded – undo
1667 1665
         $qCarga = 0;
1668 1666
         foreach ($this->infQ as $infQ) {
1669 1667
             if ($this->getTagValue($infQ, "cUnid") == '03') {
1670
-                $qCarga += (float)$this->getTagValue($infQ, "qCarga");
1668
+                $qCarga += (float) $this->getTagValue($infQ, "qCarga");
1671 1669
             }
1672 1670
         }
1673 1671
         $texto = !empty($qCarga) ? number_format($qCarga, 3, ",", ".") : '';
Please login to merge, or discard this patch.
src/Legacy/Pdf.php 1 patch
Doc Comments   +48 added lines, -46 removed lines patch added patch discarded remove patch
@@ -162,6 +162,8 @@  discard block
 block discarded – undo
162 162
 
163 163
     /**
164 164
      * Imprime barcode 128
165
+     * @param double $x
166
+     * @param integer $h
165 167
      */
166 168
     public function code128($x, $y, $code, $w, $h)
167 169
     {
@@ -235,9 +237,9 @@  discard block
 block discarded – undo
235 237
 
236 238
     /**
237 239
      * Rotaciona para impressão paisagem (landscape)
238
-     * @param   number $angle
239
-     * @param   number $x
240
-     * @param   number $y
240
+     * @param   integer $angle
241
+     * @param   integer $x
242
+     * @param   integer $y
241 243
      */
242 244
     public function rotate($angle, $x = -1, $y = -1)
243 245
     {
@@ -279,7 +281,7 @@  discard block
 block discarded – undo
279 281
      * @param   number $y
280 282
      * @param   number $w
281 283
      * @param   number $h
282
-     * @param   number $r
284
+     * @param   double $r
283 285
      * @param   string $corners
284 286
      * @param   string $style
285 287
      */
@@ -334,12 +336,12 @@  discard block
 block discarded – undo
334 336
     
335 337
     /**
336 338
      * Desenha o arco para arredondar o canto do retangulo
337
-     * @param   number $x1
338
-     * @param   number $y1
339
-     * @param   number $x2
340
-     * @param   number $y2
341
-     * @param   number $x3
342
-     * @param   number $y3
339
+     * @param   double $x1
340
+     * @param   double $y1
341
+     * @param   double $x2
342
+     * @param   double $y2
343
+     * @param   double $x3
344
+     * @param   double $y3
343 345
      */
344 346
     private function arc($x1, $y1, $x2, $y2, $x3, $y3)
345 347
     {
@@ -363,8 +365,8 @@  discard block
 block discarded – undo
363 365
      * @param   number $y1
364 366
      * @param   number $x2
365 367
      * @param   number $y2
366
-     * @param   number $width
367
-     * @param   number $nb
368
+     * @param   integer $width
369
+     * @param   integer $nb
368 370
      */
369 371
     public function dashedRect($x1, $y1, $x2, $y2, $width = 1, $nb = 15)
370 372
     {
@@ -431,11 +433,11 @@  discard block
 block discarded – undo
431 433
      * @param   number  $w
432 434
      * @param   number  $h
433 435
      * @param   string  $txt
434
-     * @param   string  $border
436
+     * @param   integer  $border
435 437
      * @param   string  $align
436 438
      * @param   boolean $fill
437
-     * @param   number  $maxline
438
-     * @param   number  $prn
439
+     * @param   integer  $maxline
440
+     * @param   integer  $prn
439 441
      * @return  int
440 442
      */
441 443
     private function drawRows($w, $h, $txt, $border = 0, $align = 'J', $fill = false, $maxline = 0, $prn = 0)
@@ -564,7 +566,7 @@  discard block
 block discarded – undo
564 566
     
565 567
     /**
566 568
      * Quebra o texto para caber na caixa
567
-     * @param   type $text
569
+     * @param   string $text
568 570
      * @param   type $maxwidth
569 571
      * @return  int
570 572
      */
@@ -615,10 +617,10 @@  discard block
 block discarded – undo
615 617
     /**
616 618
      * Celula com escala horizontal caso o texto seja muito largo
617 619
      * @param   number  $w
618
-     * @param   number  $h
620
+     * @param   integer  $h
619 621
      * @param   string  $txt
620
-     * @param   number  $border
621
-     * @param   number  $ln
622
+     * @param   integer  $border
623
+     * @param   integer  $ln
622 624
      * @param   string  $align
623 625
      * @param   boolean $fill
624 626
      * @param   string  $link
@@ -669,10 +671,10 @@  discard block
 block discarded – undo
669 671
     /**
670 672
      * Celula com escalamento horizontal somente se necessário
671 673
      * @param   number  $w
672
-     * @param   number  $h
674
+     * @param   integer  $h
673 675
      * @param   string  $txt
674
-     * @param   number  $border
675
-     * @param   number  $ln
676
+     * @param   integer  $border
677
+     * @param   integer  $ln
676 678
      * @param   string  $align
677 679
      * @param   boolean $fill
678 680
      * @param   string  $link
@@ -685,10 +687,10 @@  discard block
 block discarded – undo
685 687
     /**
686 688
      * Celula com escalamento forçado
687 689
      * @param   number  $w
688
-     * @param   number  $h
690
+     * @param   integer  $h
689 691
      * @param   string  $txt
690
-     * @param   number  $border
691
-     * @param   number  $ln
692
+     * @param   integer  $border
693
+     * @param   integer  $ln
692 694
      * @param   string  $align
693 695
      * @param   boolean $fill
694 696
      * @param   string  $link
@@ -709,10 +711,10 @@  discard block
 block discarded – undo
709 711
     /**
710 712
      * Celula com espaçamento de caracteres somente se necessário
711 713
      * @param   number  $w
712
-     * @param   number  $h
714
+     * @param   integer  $h
713 715
      * @param   string  $txt
714
-     * @param   number  $border
715
-     * @param   number  $ln
716
+     * @param   integer  $border
717
+     * @param   integer  $ln
716 718
      * @param   string  $align
717 719
      * @param   boolean $fill
718 720
      * @param   string  $link
@@ -725,10 +727,10 @@  discard block
 block discarded – undo
725 727
     /**
726 728
      * Celula com espaçamento de caracteres forçado
727 729
      * @param   number  $w
728
-     * @param   number  $h
730
+     * @param   integer  $h
729 731
      * @param   string  $txt
730
-     * @param   number  $border
731
-     * @param   number  $ln
732
+     * @param   integer  $border
733
+     * @param   integer  $ln
732 734
      * @param   string  $align
733 735
      * @param   boolean $fill
734 736
      * @param   string  $link
@@ -774,9 +776,9 @@  discard block
 block discarded – undo
774 776
      * Desenha uma linha horizontal tracejada com o FPDF
775 777
      * @param   number $x Posição horizontal inicial, em mm
776 778
      * @param   number $y Posição vertical inicial, em mm
777
-     * @param   number $w Comprimento da linha, em mm
778
-     * @param   number $h Espessura da linha, em mm
779
-     * @param   number $n Numero de traços na seção da linha com o comprimento $w
779
+     * @param   double $w Comprimento da linha, em mm
780
+     * @param   double $h Espessura da linha, em mm
781
+     * @param   integer $n Numero de traços na seção da linha com o comprimento $w
780 782
      * @return  none
781 783
      */
782 784
     public function dashedHLine($x, $y, $w, $h, $n)
@@ -796,11 +798,11 @@  discard block
 block discarded – undo
796 798
 
797 799
    /**
798 800
     * Desenha uma linha vertical tracejada com o FPDF
799
-    * @param   number $x      Posição horizontal inicial, em mm
801
+    * @param   integer $x      Posição horizontal inicial, em mm
800 802
     * @param   number $y      Posição vertical inicial, em mm
801
-    * @param   number $w      Espessura da linha, em mm
802
-    * @param   number $yfinal posição final
803
-    * @param   number $n      Numero de traços na seção da linha com o comprimento $w
803
+    * @param   double $w      Espessura da linha, em mm
804
+    * @param   double $yfinal posição final
805
+    * @param   integer $n      Numero de traços na seção da linha com o comprimento $w
804 806
     * @return  none
805 807
     */
806 808
     public function dashedVLine($x, $y, $w, $yfinal, $n)
@@ -822,7 +824,7 @@  discard block
 block discarded – undo
822 824
      * pGetNumLines
823 825
      * Obtem o numero de linhas usadas pelo texto usando a fonte especifidada
824 826
      * @param  string $text
825
-     * @param  number $width
827
+     * @param  double $width
826 828
      * @param  array  $aFont
827 829
      * @return number numero de linhas
828 830
      */
@@ -856,8 +858,8 @@  discard block
 block discarded – undo
856 858
      * fonte até caber no espaço, se falso mantem o tamanho do fonte e usa quantas linhas forem necessárias
857 859
      * e para isso atera o tamanho do fonte até caber no espaço,
858 860
      * se falso mantem o tamanho do fonte e usa quantas linhas forem necessárias
859
-     * @param  number  $hmax
860
-     * @param  number  $vOffSet incremento forçado na na posição Y
861
+     * @param  integer  $hmax
862
+     * @param  integer  $vOffSet incremento forçado na na posição Y
861 863
      * @return number $height Qual a altura necessária para desenhar esta textBox
862 864
      */
863 865
     public function textBox(
@@ -979,20 +981,20 @@  discard block
 block discarded – undo
979 981
      * 'size'=>10,'style='B'),'C','L',FALSE,'http://www.nfephp.org')
980 982
      * @param  number $x Posição horizontal da caixa, canto esquerdo superior
981 983
      * @param  number $y Posição vertical da caixa, canto esquerdo superior
982
-     * @param  number $w Largura da caixa
983
-     * @param  number $h Altura da caixa
984
+     * @param  double $w Largura da caixa
985
+     * @param  integer $h Altura da caixa
984 986
      * @param  string $text Conteúdo da caixa
985 987
      * @param  array $aFont Matriz com as informações para formatação do texto com fonte, tamanho e estilo
986 988
      * @param  string $vAlign Alinhamento vertical do texto, T-topo C-centro B-base
987 989
      * @param  string $hAlign Alinhamento horizontal do texto, L-esquerda, C-centro, R-direita
988
-     * @param  boolean $border TRUE ou 1 desenha a borda, FALSE ou 0 Sem borda
990
+     * @param  integer $border TRUE ou 1 desenha a borda, FALSE ou 0 Sem borda
989 991
      * @param  string $link Insere um hiperlink
990 992
      * @param  boolean $force Se for true força a caixa com uma unica linha e para isso atera o tamanho do
991 993
      *  fonte até caber no espaço, se falso mantem o tamanho do fonte e usa quantas linhas forem necessárias
992 994
      *  linha e para isso atera o tamanho do fonte até caber no espaço,
993 995
      *  se falso mantem o tamanho do fonte e usa quantas linhas forem necessárias
994
-     * @param  number  $hmax
995
-     * @param  number  $vOffSet incremento forçado na na posição Y
996
+     * @param  integer  $hmax
997
+     * @param  integer  $vOffSet incremento forçado na na posição Y
996 998
      * @return number $height Qual a altura necessária para desenhar esta textBox
997 999
      */
998 1000
     public function textBox90(
Please login to merge, or discard this patch.
src/NFe/Danfe.php 2 patches
Doc Comments   +22 added lines, -14 removed lines patch added patch discarded remove patch
@@ -791,8 +791,8 @@  discard block
 block discarded – undo
791 791
      *header
792 792
      * Monta o cabelhalho da DANFE (retrato e paisagem)
793 793
      *
794
-     * @param  number $x      Posição horizontal inicial, canto esquerdo
795
-     * @param  number $y      Posição vertical inicial, canto superior
794
+     * @param  integer $x      Posição horizontal inicial, canto esquerdo
795
+     * @param  integer $y      Posição vertical inicial, canto superior
796 796
      * @param  number $pag    Número da Página
797 797
      * @param  number $totPag Total de páginas
798 798
      * @return number Posição vertical final
@@ -1277,8 +1277,8 @@  discard block
 block discarded – undo
1277 1277
      * Monta o campo com os dados do destinatário na DANFE. (retrato e paisagem)
1278 1278
      *
1279 1279
      * @name   destinatarioDANFE
1280
-     * @param  number $x Posição horizontal canto esquerdo
1281
-     * @param  number $y Posição vertical canto superior
1280
+     * @param  integer $x Posição horizontal canto esquerdo
1281
+     * @param  integer $y Posição vertical canto superior
1282 1282
      * @return number Posição vertical final
1283 1283
      */
1284 1284
     protected function destinatarioDANFE($x = 0, $y = 0)
@@ -1489,8 +1489,8 @@  discard block
 block discarded – undo
1489 1489
      * Monta o campo com os dados do local de entrega na DANFE. (retrato e paisagem)
1490 1490
      *
1491 1491
      * @name   localEntregaDANFE
1492
-     * @param  number $x Posição horizontal canto esquerdo
1493
-     * @param  number $y Posição vertical canto superior
1492
+     * @param  integer $x Posição horizontal canto esquerdo
1493
+     * @param  integer $y Posição vertical canto superior
1494 1494
      * @return number Posição vertical final
1495 1495
      */
1496 1496
     protected function localEntregaDANFE($x = 0, $y = 0)
@@ -1639,8 +1639,8 @@  discard block
 block discarded – undo
1639 1639
      * Monta o campo com os dados do local de entrega na DANFE. (retrato e paisagem)
1640 1640
      *
1641 1641
      * @name   localretiradaDANFE
1642
-     * @param  number $x Posição horizontal canto esquerdo
1643
-     * @param  number $y Posição vertical canto superior
1642
+     * @param  integer $x Posição horizontal canto esquerdo
1643
+     * @param  integer $y Posição vertical canto superior
1644 1644
      * @return number Posição vertical final
1645 1645
      */
1646 1646
     protected function localRetiradaDANFE($x = 0, $y = 0)
@@ -1789,7 +1789,7 @@  discard block
 block discarded – undo
1789 1789
      * Gera a String do Texto da Fatura
1790 1790
       *
1791 1791
      * @name   getTextoFatura
1792
-     * @return uma String com o texto ou "";
1792
+     * @return string String com o texto ou "";
1793 1793
      */
1794 1794
     protected function getTextoFatura()
1795 1795
     {
@@ -1844,7 +1844,7 @@  discard block
 block discarded – undo
1844 1844
      *
1845 1845
      * @name   fatura
1846 1846
      * @param  number $x Posição horizontal canto esquerdo
1847
-     * @param  number $y Posição vertical canto superior
1847
+     * @param  double $y Posição vertical canto superior
1848 1848
      * @return number Posição vertical final
1849 1849
      */
1850 1850
     protected function fatura($x, $y)
@@ -1967,7 +1967,7 @@  discard block
 block discarded – undo
1967 1967
      *
1968 1968
      * @name   pagamento
1969 1969
      * @param  number $x Posição horizontal canto esquerdo
1970
-     * @param  number $y Posição vertical canto superior
1970
+     * @param  double $y Posição vertical canto superior
1971 1971
      * @return number Posição vertical final
1972 1972
      */
1973 1973
     protected function pagamento($x, $y)
@@ -2075,6 +2075,8 @@  discard block
 block discarded – undo
2075 2075
      * @param  float $h Altura do campo
2076 2076
      * @param  float $h Título do campo
2077 2077
      * @param  float $h Valor do imposto
2078
+     * @param string $titulo
2079
+     * @param string $campoImposto
2078 2080
      * @return float Sugestão do $x do próximo imposto
2079 2081
      */
2080 2082
     protected function impostoHelper($x, $y, $w, $h, $titulo, $campoImposto)
@@ -2102,8 +2104,8 @@  discard block
 block discarded – undo
2102 2104
      * Monta o campo de impostos e totais da DANFE (retrato e paisagem)
2103 2105
      *
2104 2106
      * @param  number $x Posição horizontal canto esquerdo
2105
-     * @param  number $y Posição vertical canto superior
2106
-     * @return number Posição vertical final
2107
+     * @param  double $y Posição vertical canto superior
2108
+     * @return double Posição vertical final
2107 2109
      */
2108 2110
     protected function imposto($x, $y)
2109 2111
     {
@@ -2499,6 +2501,10 @@  discard block
 block discarded – undo
2499 2501
 
2500 2502
 
2501 2503
 
2504
+    /**
2505
+     * @param string $campo
2506
+     * @param string $formato
2507
+     */
2502 2508
     protected function descricaoProdutoHelper($origem, $campo, $formato)
2503 2509
     {
2504 2510
         $valor_original = $origem->getElementsByTagName($campo)->item(0);
@@ -2603,7 +2609,6 @@  discard block
 block discarded – undo
2603 2609
      * @param  float $x       Posição horizontal canto esquerdo
2604 2610
      * @param  float $y       Posição vertical canto superior
2605 2611
      * @param  float $nInicio Número do item inicial
2606
-     * @param  float $max     Número do item final
2607 2612
      * @param  float $hmax    Altura máxima do campo de itens em mm
2608 2613
      * @return float Posição vertical final
2609 2614
      */
@@ -3596,6 +3601,9 @@  discard block
 block discarded – undo
3596 3601
         return $saida;
3597 3602
     }
3598 3603
     
3604
+    /**
3605
+     * @param string $xml
3606
+     */
3599 3607
     private function loadDoc($xml)
3600 3608
     {
3601 3609
         $this->xml = $xml;
Please login to merge, or discard this patch.
Indentation   +26 added lines, -27 removed lines patch added patch discarded remove patch
@@ -238,7 +238,6 @@  discard block
 block discarded – undo
238 238
      * A definição de margens e posições iniciais para a impressão são estabelecidas
239 239
      * pelo conteúdo da funçao e podem ser modificados.
240 240
      *
241
-
242 241
      * @return string O ID da NFe numero de 44 digitos extraido do arquivo XML
243 242
      */
244 243
     protected function monta(
@@ -369,7 +368,7 @@  discard block
 block discarded – undo
369 368
                 $this->textoAdic .= ". \r\n";
370 369
             }
371 370
             $this->textoAdic .= "LOCAL DE ENTREGA : ".$txRetCNPJ.'-'.$txRetxLgr.', '.$txRetnro.' '.$txRetxCpl.
372
-               ' - '.$txRetxBairro.' '.$txRetxMun.' - '.$txRetUF."\r\n";
371
+                ' - '.$txRetxBairro.' '.$txRetxMun.' - '.$txRetUF."\r\n";
373 372
         }
374 373
         //informações adicionais
375 374
         $this->textoAdic .= $this->geraInformacoesDasNotasReferenciadas();
@@ -802,7 +801,7 @@  discard block
 block discarded – undo
802 801
         $oldX = $x;
803 802
         $oldY = $y;
804 803
         if ($this->orientacao == 'P') {
805
-              $maxW = $this->wPrint;
804
+                $maxW = $this->wPrint;
806 805
         } else {
807 806
             if ($pag == 1) { // primeira página
808 807
                 $maxW = $this->wPrint - $this->wCanhoto;
@@ -1179,8 +1178,8 @@  discard block
 block discarded – undo
1179 1178
             $w = $maxW-(2*$x);
1180 1179
             $this->pdf->SetTextColor(200, 200, 200);
1181 1180
             $texto = "DANFE impresso em contingência -\n".
1182
-                     "DPEC regularmente recebido pela Receita\n".
1183
-                     "Federal do Brasil";
1181
+                        "DPEC regularmente recebido pela Receita\n".
1182
+                        "Federal do Brasil";
1184 1183
             $aFont = ['font'=>$this->fontePadrao, 'size'=>48, 'style'=>'B'];
1185 1184
             $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'C', 'C', 0, '');
1186 1185
             $this->pdf->SetTextColor(0, 0, 0);
@@ -1784,13 +1783,13 @@  discard block
 block discarded – undo
1784 1783
         return ($y + $h);
1785 1784
     } //fim da função localRetiradaDANFE
1786 1785
     
1787
-     /**
1788
-     * getTextoFatura
1789
-     * Gera a String do Texto da Fatura
1790
-      *
1791
-     * @name   getTextoFatura
1792
-     * @return uma String com o texto ou "";
1793
-     */
1786
+        /**
1787
+         * getTextoFatura
1788
+         * Gera a String do Texto da Fatura
1789
+         *
1790
+         * @name   getTextoFatura
1791
+         * @return uma String com o texto ou "";
1792
+         */
1794 1793
     protected function getTextoFatura()
1795 1794
     {
1796 1795
         if (isset($this->cobr)) {
@@ -1821,13 +1820,13 @@  discard block
 block discarded – undo
1821 1820
         return "";
1822 1821
     }
1823 1822
 
1824
-     /**
1825
-     * sizeExtraTextoFatura
1826
-     * Calcula o espaço ocupado pelo texto da fatura. Este espaço só é utilizado quando não houver duplicata.
1827
-      *
1828
-     * @name   sizeExtraTextoFatura
1829
-     * @return integer
1830
-     */
1823
+        /**
1824
+         * sizeExtraTextoFatura
1825
+         * Calcula o espaço ocupado pelo texto da fatura. Este espaço só é utilizado quando não houver duplicata.
1826
+         *
1827
+         * @name   sizeExtraTextoFatura
1828
+         * @return integer
1829
+         */
1831 1830
     protected function sizeExtraTextoFatura()
1832 1831
     {
1833 1832
         $textoFatura = $this->getTextoFatura();
@@ -2007,7 +2006,7 @@  discard block
 block discarded – undo
2007 2006
                                     '11'=>'Vale Refeição','12'=>'Vale Presente','13'=>'Vale Combustível',
2008 2007
                                     '14'=>'Duplicata Mercantil','15'=>'Boleto','90'=>'Sem pagamento','99'=>'Outros'];
2009 2008
             $bandeira = ['01'=>'Visa','02'=>'Mastercard','03'=>'American','04'=>'Sorocred','05'=>'Diners',
2010
-                              '06'=>'Elo','07'=>'Hipercard','08'=>'Aura','09'=>'Cabal','99'=>'Outros'];
2009
+                                '06'=>'Elo','07'=>'Hipercard','08'=>'Aura','09'=>'Cabal','99'=>'Outros'];
2011 2010
             foreach ($this->detPag as $k => $d) {
2012 2011
                 $fPag = !empty($this->detPag->item($k)->getElementsByTagName('tPag')->item(0)->nodeValue)
2013 2012
                 ? $this->detPag->item($k)->getElementsByTagName('tPag')->item(0)->nodeValue
@@ -2660,7 +2659,7 @@  discard block
 block discarded – undo
2660 2659
         $w4 = round($w*0.05, 0);
2661 2660
         $texto = 'O/CSOSN';//Regime do Simples CRT = 1 ou CRT = 2
2662 2661
         if ($this->getTagValue($this->emit, 'CRT') == '3') {
2663
-             $texto = 'O/CST';//Regime Normal
2662
+                $texto = 'O/CST';//Regime Normal
2664 2663
         }
2665 2664
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
2666 2665
         $this->pdf->textBox($x, $y, $w4, $h, $texto, $aFont, 'C', 'C', 0, '', false);
@@ -3064,7 +3063,7 @@  discard block
 block discarded – undo
3064 3063
         $this->pdf->textBox($x, $yVeic, $w1+40, $h, $texto, $aFont, 'T', 'L', 0, '');
3065 3064
         $yVeic += $h;
3066 3065
         $texto = 'Tipo.................: ' . ($renavamTiposVeiculos[intval($veiculoTipo)] ?? $veiculoTipo);
3067
-         $this->pdf->textBox($x, $yVeic, $w1+40, $h, $texto, $aFont, 'T', 'L', 0, '');
3066
+            $this->pdf->textBox($x, $yVeic, $w1+40, $h, $texto, $aFont, 'T', 'L', 0, '');
3068 3067
         $yVeic = $y + $h;
3069 3068
         $xVeic = $x + 65;
3070 3069
         $texto = 'Nº Motor: .........: ' . $veiculoMotor;
@@ -3198,9 +3197,9 @@  discard block
 block discarded – undo
3198 3197
         //DADOS ADICIONAIS
3199 3198
         $texto = "DADOS ADICIONAIS";
3200 3199
         if ($this->orientacao == 'P') {
3201
-              $w = $this->wPrint;
3200
+                $w = $this->wPrint;
3202 3201
         } else {
3203
-              $w = $this->wPrint-$this->wCanhoto;
3202
+                $w = $this->wPrint-$this->wCanhoto;
3204 3203
         }
3205 3204
         $aFont = ['font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B'];
3206 3205
         $this->pdf->textBox($x, $y, $w, 8, $texto, $aFont, 'T', 'L', 0, '');
@@ -3284,10 +3283,10 @@  discard block
 block discarded – undo
3284 3283
         
3285 3284
         $y = $this->maxH - 4;
3286 3285
         if ($this->orientacao == 'P') {
3287
-              $w = $this->wPrint;
3286
+                $w = $this->wPrint;
3288 3287
         } else {
3289
-              $w = $this->wPrint-$this->wCanhoto;
3290
-              $x = $this->wCanhoto;
3288
+                $w = $this->wPrint-$this->wCanhoto;
3289
+                $x = $this->wCanhoto;
3291 3290
         }
3292 3291
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'I'];
3293 3292
         $texto = "Impresso em ". date('d/m/Y') . " as " . date('H:i:s')
Please login to merge, or discard this patch.
src/NFe/Danfce.php 1 patch
Spacing   +80 added lines, -80 removed lines patch added patch discarded remove patch
@@ -26,8 +26,8 @@  discard block
 block discarded – undo
26 26
     protected $papel;
27 27
     protected $paperwidth = 80;
28 28
     protected $xml; // string XML NFe
29
-    protected $logomarca=''; // path para logomarca em jpg
30
-    protected $formatoChave="#### #### #### #### #### #### #### #### #### #### ####";
29
+    protected $logomarca = ''; // path para logomarca em jpg
30
+    protected $formatoChave = "#### #### #### #### #### #### #### #### #### #### ####";
31 31
     protected $nfeProc;
32 32
     protected $nfe;
33 33
     protected $infNFe;
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
         $this->textoAdic = '';
169 169
         if (isset($this->infAdic)) {
170 170
             $this->textoAdic .= !empty($this->infAdic->getElementsByTagName('infCpl')->item(0)->nodeValue) ?
171
-            'Inf. Contribuinte: '.
171
+            'Inf. Contribuinte: ' .
172 172
             trim($this->anfaveaDANFE($this->infAdic->getElementsByTagName('infCpl')->item(0)->nodeValue)) : '';
173 173
             if (!empty($this->textoAdic)) {
174 174
                 $this->textoAdic = str_replace(";", "\n", $this->textoAdic);
@@ -207,10 +207,10 @@  discard block
 block discarded – undo
207 207
         //total inicial de paginas
208 208
         $totPag = 1;
209 209
         //largura imprimivel em mm: largura da folha menos as margens esq/direita
210
-        $this->wPrint = $maxW-($margEsq*2);
210
+        $this->wPrint = $maxW - ($margEsq * 2);
211 211
         //comprimento (altura) imprimivel em mm: altura da folha menos as margens
212 212
         //superior e inferior
213
-        $this->hPrint = $maxH-$margSup-$margInf;
213
+        $this->hPrint = $maxH - $margSup - $margInf;
214 214
         // estabelece contagem de paginas
215 215
         $this->pdf->aliasNbPages();
216 216
         $this->pdf->setMargins($margEsq, $margSup); // fixa as margens
@@ -221,11 +221,11 @@  discard block
 block discarded – undo
221 221
         $this->pdf->setLineWidth(0.1); // define a largura da linha
222 222
         $this->pdf->setTextColor(0, 0, 0);
223 223
         $this->pdf->textBox(0, 0, $maxW, $maxH); // POR QUE PRECISO DESA LINHA?
224
-        $hcabecalho = 27;//para cabeçalho (dados emitente mais logomarca)  (FIXO)
225
-        $hcabecalhoSecundario = 10 + 3;//para cabeçalho secundário (cabeçalho sefaz) (FIXO)
226
-        $hprodutos = $hLinha + ($qtdItens * $hMaxLinha) ;//box poduto
224
+        $hcabecalho = 27; //para cabeçalho (dados emitente mais logomarca)  (FIXO)
225
+        $hcabecalhoSecundario = 10 + 3; //para cabeçalho secundário (cabeçalho sefaz) (FIXO)
226
+        $hprodutos = $hLinha + ($qtdItens * $hMaxLinha); //box poduto
227 227
         $hTotal = 12; //box total (FIXO)
228
-        $hpagamentos = $hLinha + ($qtdPgto * $hLinha) + 3;//para pagamentos
228
+        $hpagamentos = $hLinha + ($qtdPgto * $hLinha) + 3; //para pagamentos
229 229
         if (!empty($this->vTroco)) {
230 230
             $hpagamentos += $hLinha;
231 231
         }
@@ -258,7 +258,7 @@  discard block
 block discarded – undo
258 258
         $y = $xInic + $hcabecalho + $hcabecalhoSecundario + $hprodutos + $hTotal;
259 259
         $y = $this->pagamentosDANFE($x, $y, $hpagamentos);
260 260
         //COLOCA MENSAGEM FISCAL
261
-        $y = $xInic + $hcabecalho + $hcabecalhoSecundario + $hprodutos + $hTotal+ $hpagamentos;
261
+        $y = $xInic + $hcabecalho + $hcabecalhoSecundario + $hprodutos + $hTotal + $hpagamentos;
262 262
         $y = $this->fiscalDANFE($x, $y, $hmsgfiscal);
263 263
         //COLOCA CONSUMIDOR
264 264
         $y = $xInic + $hcabecalho + $hcabecalhoSecundario + $hprodutos + $hTotal + $hpagamentos + $hmsgfiscal;
@@ -286,14 +286,14 @@  discard block
 block discarded – undo
286 286
         $emitIM     = $this->getTagValue($this->emit, "IM");
287 287
         $emitFone = $this->getTagValue($this->enderEmit, "fone");
288 288
         $foneLen = strlen($emitFone);
289
-        if ($foneLen>0) {
289
+        if ($foneLen > 0) {
290 290
             $ddd = substr($emitFone, 0, 2);
291 291
             $fone1 = substr($emitFone, -8);
292 292
             $digito9 = ' ';
293 293
             if ($foneLen == 11) {
294 294
                 $digito9 = substr($emitFone, 2, 1);
295 295
             }
296
-            $emitFone = ' - ('.$ddd.') '.$digito9. ' ' . substr($fone1, 0, 4) . '-' . substr($fone1, -4);
296
+            $emitFone = ' - (' . $ddd . ') ' . $digito9 . ' ' . substr($fone1, 0, 4) . '-' . substr($fone1, -4);
297 297
         } else {
298 298
             $emitFone = '';
299 299
         }
@@ -307,24 +307,24 @@  discard block
 block discarded – undo
307 307
         // CONFIGURAÇÃO DE POSIÇÃO
308 308
         $margemInterna = $this->margemInterna;
309 309
         $maxW = $this->wPrint;
310
-        $h = $h-($margemInterna);
310
+        $h = $h - ($margemInterna);
311 311
         //COLOCA LOGOMARCA
312 312
         if (!empty($this->logomarca)) {
313 313
             $xImg = $margemInterna;
314 314
             $yImg = $margemInterna + 1;
315 315
             $logoInfo = getimagesize($this->logomarca);
316
-            $logoWmm = ($logoInfo[0]/72)*25.4;
317
-            $logoHmm = ($logoInfo[1]/72)*25.4;
316
+            $logoWmm = ($logoInfo[0] / 72) * 25.4;
317
+            $logoHmm = ($logoInfo[1] / 72) * 25.4;
318 318
             $nImgW = 30;
319
-            $nImgH = round($logoHmm * ($nImgW/$logoWmm), 0);
320
-            $yImg = $margemInterna + $nImgH/2;
319
+            $nImgH = round($logoHmm * ($nImgW / $logoWmm), 0);
320
+            $yImg = $margemInterna + $nImgH / 2;
321 321
             $this->pdf->image($this->logomarca, $xImg, $yImg, $nImgW, $nImgH, 'jpeg');
322
-            $xRs = ($maxW*0.4) + $margemInterna;
323
-            $wRs = ($maxW*0.6);
322
+            $xRs = ($maxW * 0.4) + $margemInterna;
323
+            $wRs = ($maxW * 0.6);
324 324
             $alignEmit = 'L';
325 325
         } else {
326 326
             $xRs = $margemInterna;
327
-            $wRs = ($maxW*1);
327
+            $wRs = ($maxW * 1);
328 328
             $alignEmit = 'L';
329 329
         }
330 330
         //COLOCA RAZÃO SOCIAL
@@ -344,7 +344,7 @@  discard block
 block discarded – undo
344 344
     {
345 345
         $margemInterna = $this->margemInterna;
346 346
         $maxW = $this->wPrint;
347
-        $w = ($maxW*1);
347
+        $w = ($maxW * 1);
348 348
         $hBox1 = 7;
349 349
         $texto = "DANFE NFC-e\nDocumento Auxiliar da Nota Fiscal de Consumidor Eletrônica";
350 350
         $aFont = array('font'=>$this->fontePadrao, 'size'=>8, 'style'=>'B');
@@ -361,13 +361,13 @@  discard block
 block discarded – undo
361 361
         $margemInterna = $this->margemInterna;
362 362
         $maxW = $this->wPrint;
363 363
         $qtdItens = $this->det->length;
364
-        $w = ($maxW*1);
364
+        $w = ($maxW * 1);
365 365
         $hLinha = $this->hLinha;
366 366
         $aFontCabProdutos = array('font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B');
367
-        $wBoxCod = $w*0.17;
367
+        $wBoxCod = $w * 0.17;
368 368
         $texto = "CÓDIGO";
369 369
         $this->pdf->textBox($x, $y, $wBoxCod, $hLinha, $texto, $aFontCabProdutos, 'T', 'L', 0, '', false);
370
-        $wBoxDescricao = $w*0.43;
370
+        $wBoxDescricao = $w * 0.43;
371 371
         $xBoxDescricao = $wBoxCod + $x;
372 372
         $texto = "DESCRICÃO";
373 373
         $this->pdf->textBox(
@@ -383,19 +383,19 @@  discard block
 block discarded – undo
383 383
             '',
384 384
             false
385 385
         );
386
-        $wBoxQt = $w*0.08;
386
+        $wBoxQt = $w * 0.08;
387 387
         $xBoxQt = $wBoxDescricao + $xBoxDescricao;
388 388
         $texto = "QT";
389 389
         $this->pdf->textBox($xBoxQt, $y, $wBoxQt, $hLinha, $texto, $aFontCabProdutos, 'T', 'L', 0, '', false);
390
-        $wBoxUn = $w*0.06;
390
+        $wBoxUn = $w * 0.06;
391 391
         $xBoxUn = $wBoxQt + $xBoxQt;
392 392
         $texto = "UN";
393 393
         $this->pdf->textBox($xBoxUn, $y, $wBoxUn, $hLinha, $texto, $aFontCabProdutos, 'T', 'L', 0, '', false);
394
-        $wBoxVl = $w*0.13;
394
+        $wBoxVl = $w * 0.13;
395 395
         $xBoxVl = $wBoxUn + $xBoxUn;
396 396
         $texto = "VALOR";
397 397
         $this->pdf->textBox($xBoxVl, $y, $wBoxVl, $hLinha, $texto, $aFontCabProdutos, 'T', 'L', 0, '', false);
398
-        $wBoxTotal = $w*0.13;
398
+        $wBoxTotal = $w * 0.13;
399 399
         $xBoxTotal = $wBoxVl + $xBoxVl;
400 400
         $texto = "TOTAL";
401 401
         $this->pdf->textBox($xBoxTotal, $y, $wBoxTotal, $hLinha, $texto, $aFontCabProdutos, 'T', 'L', 0, '', false);
@@ -415,9 +415,9 @@  discard block
 block discarded – undo
415 415
                 $vUnCom     = number_format($this->getTagValue($prod, "vUnCom"), 2, ",", ".");
416 416
                 $vProd      = number_format($this->getTagValue($prod, "vProd"), 2, ",", ".");
417 417
                 //COLOCA PRODUTO
418
-                $yBoxProd = $y + $hLinha + ($cont*$hMaxLinha);
418
+                $yBoxProd = $y + $hLinha + ($cont * $hMaxLinha);
419 419
                 //COLOCA PRODUTO CÓDIGO
420
-                $wBoxCod = $w*0.17;
420
+                $wBoxCod = $w * 0.17;
421 421
                 $texto = $cProd;
422 422
                 $this->pdf->textBox(
423 423
                     $x,
@@ -433,7 +433,7 @@  discard block
 block discarded – undo
433 433
                     false
434 434
                 );
435 435
                 //COLOCA PRODUTO DESCRIÇÃO
436
-                $wBoxDescricao = $w*0.43;
436
+                $wBoxDescricao = $w * 0.43;
437 437
                 $xBoxDescricao = $wBoxCod + $x;
438 438
                 $texto = $xProd;
439 439
                 $this->pdf->textBox(
@@ -450,7 +450,7 @@  discard block
 block discarded – undo
450 450
                     false
451 451
                 );
452 452
                 //COLOCA PRODUTO QUANTIDADE
453
-                $wBoxQt = $w*0.08;
453
+                $wBoxQt = $w * 0.08;
454 454
                 $xBoxQt = $wBoxDescricao + $xBoxDescricao;
455 455
                 $texto = $qCom;
456 456
                 $this->pdf->textBox(
@@ -467,7 +467,7 @@  discard block
 block discarded – undo
467 467
                     false
468 468
                 );
469 469
                 //COLOCA PRODUTO UNIDADE
470
-                $wBoxUn = $w*0.06;
470
+                $wBoxUn = $w * 0.06;
471 471
                 $xBoxUn = $wBoxQt + $xBoxQt;
472 472
                 $texto = $uCom;
473 473
                 $this->pdf->textBox(
@@ -484,7 +484,7 @@  discard block
 block discarded – undo
484 484
                     false
485 485
                 );
486 486
                 //COLOCA PRODUTO VL UNITÁRIO
487
-                $wBoxVl = $w*0.13;
487
+                $wBoxVl = $w * 0.13;
488 488
                 $xBoxVl = $wBoxUn + $xBoxUn;
489 489
                 $texto = $vUnCom;
490 490
                 $this->pdf->textBox(
@@ -501,7 +501,7 @@  discard block
 block discarded – undo
501 501
                     false
502 502
                 );
503 503
                 //COLOCA PRODUTO VL TOTAL
504
-                $wBoxTotal = $w*0.13;
504
+                $wBoxTotal = $w * 0.13;
505 505
                 $xBoxTotal = $wBoxVl + $xBoxVl;
506 506
                 $texto = $vProd;
507 507
                 $this->pdf->textBox(
@@ -528,8 +528,8 @@  discard block
 block discarded – undo
528 528
         $margemInterna = $this->margemInterna;
529 529
         $maxW = $this->wPrint;
530 530
         $hLinha = 3;
531
-        $wColEsq = ($maxW*0.7);
532
-        $wColDir = ($maxW*0.3);
531
+        $wColEsq = ($maxW * 0.7);
532
+        $wColDir = ($maxW * 0.3);
533 533
         $xValor = $x + $wColEsq;
534 534
         $qtdItens = $this->det->length;
535 535
         $vProd = $this->getTagValue($this->ICMSTot, "vProd");
@@ -550,28 +550,28 @@  discard block
 block discarded – undo
550 550
         $texto = "R$ " . number_format($vProd, 2, ",", ".");
551 551
         $aFont = ['font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B'];
552 552
         $this->pdf->textBox($xValor, $yTotal, $wColDir, $hLinha, $texto, $aFont, 'T', 'R', 0, '', false);
553
-        $yDesconto = $y + ($hLinha*2);
553
+        $yDesconto = $y + ($hLinha * 2);
554 554
         $texto = "Descontos";
555 555
         $aFont = ['font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B'];
556 556
         $this->pdf->textBox($x, $yDesconto, $wColEsq, $hLinha, $texto, $aFont, 'T', 'L', 0, '', false);
557 557
         $texto = "R$ " . $vDesc;
558 558
         $aFont = ['font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B'];
559 559
         $this->pdf->textBox($xValor, $yDesconto, $wColDir, $hLinha, $texto, $aFont, 'T', 'R', 0, '', false);
560
-        $yFrete= $y + ($hLinha*3);
560
+        $yFrete = $y + ($hLinha * 3);
561 561
         $texto = "Frete";
562 562
         $aFont = ['font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B'];
563 563
         $this->pdf->textBox($x, $yFrete, $wColEsq, $hLinha, $texto, $aFont, 'T', 'L', 0, '', false);
564 564
         $texto = "R$ " . $vFrete;
565 565
         $aFont = ['font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B'];
566 566
         $this->pdf->textBox($xValor, $yFrete, $wColDir, $hLinha, $texto, $aFont, 'T', 'R', 0, '', false);
567
-        $yTotalFinal = $y + ($hLinha*4);
567
+        $yTotalFinal = $y + ($hLinha * 4);
568 568
         $texto = "Total";
569 569
         $aFont = ['font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B'];
570 570
         $this->pdf->textBox($x, $yTotalFinal, $wColEsq, $hLinha, $texto, $aFont, 'T', 'L', 0, '', false);
571 571
         $texto = "R$ " . $vNF;
572 572
         $aFont = ['font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B'];
573 573
         $this->pdf->textBox($xValor, $yTotalFinal, $wColDir, $hLinha, $texto, $aFont, 'T', 'R', 0, '', false);
574
-        $yTotalFinal = $y + ($hLinha*5);
574
+        $yTotalFinal = $y + ($hLinha * 5);
575 575
         $texto = "Informação dos Tributos Totais Incidentes";
576 576
         $aFont = ['font'=>$this->fontePadrao, 'size'=>7, 'style'=>''];
577 577
         $this->pdf->textBox($x, $yTotalFinal, $wColEsq, $hLinha, $texto, $aFont, 'T', 'L', 0, '', false);
@@ -586,16 +586,16 @@  discard block
 block discarded – undo
586 586
         $margemInterna = $this->margemInterna;
587 587
         $maxW = $this->wPrint;
588 588
         $qtdPgto = $this->pag->length;
589
-        $w = ($maxW*1);
589
+        $w = ($maxW * 1);
590 590
         $hLinha = $this->hLinha;
591
-        $wColEsq = ($maxW*0.7);
592
-        $wColDir = ($maxW*0.3);
591
+        $wColEsq = ($maxW * 0.7);
592
+        $wColDir = ($maxW * 0.3);
593 593
         $xValor = $x + $wColEsq;
594 594
         $aFontPgto = array('font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B');
595
-        $wBoxEsq = $w*0.7;
595
+        $wBoxEsq = $w * 0.7;
596 596
         $texto = "FORMA DE PAGAMENTO";
597 597
         $this->pdf->textBox($x, $y, $wBoxEsq, $hLinha, $texto, $aFontPgto, 'T', 'L', 0, '', false);
598
-        $wBoxDir = $w*0.3;
598
+        $wBoxDir = $w * 0.3;
599 599
         $xBoxDescricao = $x + $wBoxEsq;
600 600
         $texto = "VALOR PAGO";
601 601
         $this->pdf->textBox($xBoxDescricao, $y, $wBoxDir, $hLinha, $texto, $aFontPgto, 'T', 'R', 0, '', false);
@@ -617,7 +617,7 @@  discard block
 block discarded – undo
617 617
                     $tBandNome = self::getCardName($tBand);
618 618
                 }
619 619
                 //COLOCA PRODUTO
620
-                $yBoxProd = $y + $hLinha + ($cont*$hLinha);
620
+                $yBoxProd = $y + $hLinha + ($cont * $hLinha);
621 621
                 //COLOCA PRODUTO CÓDIGO
622 622
                 $texto = $tPagNome;
623 623
                 $this->pdf->textBox($x, $yBoxProd, $wBoxEsq, $hLinha, $texto, $aFontPgto, 'T', 'L', 0, '', false);
@@ -641,7 +641,7 @@  discard block
 block discarded – undo
641 641
             }
642 642
             
643 643
             if (!empty($this->vTroco)) {
644
-                $yBoxProd = $y + $hLinha + ($cont*$hLinha);
644
+                $yBoxProd = $y + $hLinha + ($cont * $hLinha);
645 645
                 //COLOCA PRODUTO CÓDIGO
646 646
                 $texto = 'Troco';
647 647
                 $this->pdf->textBox($x, $yBoxProd, $wBoxEsq, $hLinha, $texto, $aFontPgto, 'T', 'L', 0, '', false);
@@ -670,7 +670,7 @@  discard block
 block discarded – undo
670 670
         $y += 6;
671 671
         $margemInterna = $this->margemInterna;
672 672
         $maxW = $this->wPrint;
673
-        $w = ($maxW*1);
673
+        $w = ($maxW * 1);
674 674
         $hLinha = $this->hLinha;
675 675
         $aFontTit = ['font'=>$this->fontePadrao, 'size'=>8, 'style'=>'B'];
676 676
         $aFontTex = ['font'=>$this->fontePadrao, 'size'=>8, 'style'=>''];
@@ -702,19 +702,19 @@  discard block
 block discarded – undo
702 702
         $dhEmiLocalFormat = $dhEmilocal->format('d/m/Y H:i:s');
703 703
         $texto = "ÁREA DE MENSAGEM FISCAL";
704 704
         $this->pdf->textBox($x, $y, $w, $hLinha, $texto, $aFontTit, 'C', 'C', 0, '', false);
705
-        $yTex1 = $y + ($hLinha*1);
706
-        $hTex1 = $hLinha*2;
707
-        $texto = "Número " . $nNF . " Série " . $serieNF . " " .$dhEmiLocalFormat . " - Via Consumidor";
705
+        $yTex1 = $y + ($hLinha * 1);
706
+        $hTex1 = $hLinha * 2;
707
+        $texto = "Número " . $nNF . " Série " . $serieNF . " " . $dhEmiLocalFormat . " - Via Consumidor";
708 708
         $this->pdf->textBox($x, $yTex1, $w, $hTex1, $texto, $aFontTex, 'C', 'C', 0, '', false);
709
-        $yTex2 = $y + ($hLinha*3);
710
-        $hTex2 = $hLinha*2;
709
+        $yTex2 = $y + ($hLinha * 3);
710
+        $hTex2 = $hLinha * 2;
711 711
         
712 712
         $texto = !empty($this->urlChave) ? "Consulte pela Chave de Acesso em " . $this->urlChave : '';
713 713
         $this->pdf->textBox($x, $yTex2, $w, $hTex2, $texto, $aFontTex, 'C', 'C', 0, '', false);
714 714
         $texto = "CHAVE DE ACESSO";
715
-        $yTit2 = $y + ($hLinha*5);
715
+        $yTit2 = $y + ($hLinha * 5);
716 716
         $this->pdf->textBox($x, $yTit2, $w, $hLinha, $texto, $aFontTit, 'C', 'C', 0, '', false);
717
-        $yTex3 = $y + ($hLinha*6);
717
+        $yTex3 = $y + ($hLinha * 6);
718 718
         $texto = $chNFe;
719 719
         $this->pdf->textBox($x, $yTex3, $w, $hLinha, $texto, $aFontTex, 'C', 'C', 0, '', false);
720 720
     }
@@ -724,7 +724,7 @@  discard block
 block discarded – undo
724 724
         $y += 6;
725 725
         $margemInterna = $this->margemInterna;
726 726
         $maxW = $this->wPrint;
727
-        $w = ($maxW*1);
727
+        $w = ($maxW * 1);
728 728
         $hLinha = $this->hLinha;
729 729
         $aFontTit = ['font'=>$this->fontePadrao, 'size'=>8, 'style'=>'B'];
730 730
         $aFontTex = ['font'=>$this->fontePadrao, 'size'=>8, 'style'=>''];
@@ -740,7 +740,7 @@  discard block
 block discarded – undo
740 740
             $consCNPJ = !empty($this->dest->getElementsByTagName("CNPJ")->item(0)->nodeValue)
741 741
                     ? $this->dest->getElementsByTagName("CNPJ")->item(0)->nodeValue
742 742
                     : '';
743
-            $cDest = $consCPF.$consCNPJ.$considEstrangeiro; //documentos do consumidor
743
+            $cDest = $consCPF . $consCNPJ . $considEstrangeiro; //documentos do consumidor
744 744
             $enderDest = $this->dest->getElementsByTagName("enderDest")->item(0);
745 745
             $consNome = $this->getTagValue($this->dest, "xNome");
746 746
             $consLgr = $this->getTagValue($enderDest, "xLgr");
@@ -780,8 +780,8 @@  discard block
 block discarded – undo
780 780
             $yTex1 = $y + $hLinha;
781 781
             $texto = $consNome;
782 782
             if (!empty($consDoc)) {
783
-                $texto .= " - ". $consDoc . "\n" . $consEnd;
784
-                $this->pdf->textBox($x, $yTex1, $w, $hLinha*3, $texto, $aFontTex, 'C', 'C', 0, '', false);
783
+                $texto .= " - " . $consDoc . "\n" . $consEnd;
784
+                $this->pdf->textBox($x, $yTex1, $w, $hLinha * 3, $texto, $aFontTex, 'C', 'C', 0, '', false);
785 785
             }
786 786
         } else {
787 787
             $yTex1 = $y + $hLinha;
@@ -795,7 +795,7 @@  discard block
 block discarded – undo
795 795
         $y += 6;
796 796
         $margemInterna = $this->margemInterna;
797 797
         $maxW = $this->wPrint;
798
-        $w = ($maxW*1)+4;
798
+        $w = ($maxW * 1) + 4;
799 799
         $hLinha = $this->hLinha;
800 800
         $hBoxLinha = $this->hBoxLinha;
801 801
         $aFontTit = array('font'=>$this->fontePadrao, 'size'=>8, 'style'=>'B');
@@ -804,7 +804,7 @@  discard block
 block discarded – undo
804 804
         $nProt = '';
805 805
         if (isset($this->nfeProc)) {
806 806
             $nProt = $this->getTagValue($this->nfeProc, "nProt");
807
-            $dhRecbto  = $this->getTagValue($this->nfeProc, "dhRecbto");
807
+            $dhRecbto = $this->getTagValue($this->nfeProc, "dhRecbto");
808 808
         }
809 809
         $barcode = new Barcode();
810 810
         $bobj = $barcode->getBarcodeObj(
@@ -818,15 +818,15 @@  discard block
 block discarded – undo
818 818
         $qrcode = $bobj->getPngData();
819 819
         $wQr = 50;
820 820
         $hQr = 50;
821
-        $yQr = ($y+$margemInterna);
822
-        $xQr = ($w/2) - ($wQr/2);
821
+        $yQr = ($y + $margemInterna);
822
+        $xQr = ($w / 2) - ($wQr / 2);
823 823
         // prepare a base64 encoded "data url"
824 824
         $pic = 'data://text/plain;base64,' . base64_encode($qrcode);
825 825
         $info = getimagesize($pic);
826 826
         $this->pdf->image($pic, $xQr, $yQr, $wQr, $hQr, 'PNG');
827 827
         $dt = new DateTime($dhRecbto);
828
-        $yQr = ($yQr+$hQr+$margemInterna);
829
-        $this->pdf->textBox($x, $yQr, $w-4, $hBoxLinha, "Protocolo de Autorização: " . $nProt . "\n"
828
+        $yQr = ($yQr + $hQr + $margemInterna);
829
+        $this->pdf->textBox($x, $yQr, $w - 4, $hBoxLinha, "Protocolo de Autorização: " . $nProt . "\n"
830 830
             . $dt->format('d/m/Y H:i:s'), $aFontTex, 'C', 'C', 0, '', false);
831 831
     }
832 832
    
@@ -850,7 +850,7 @@  discard block
 block discarded – undo
850 850
             $heigthText = $this->pdf->textBox($x, $y, $w, $hLinha, $texto, $aFontTit, 'C', 'C', 0, '', false);
851 851
         }
852 852
         // seta o textbox do texto adicional
853
-        $this->pdf->textBox($x, $y+3, $w-2, $hLinha-3, $this->textoAdic, $aFontTex, 'T', 'L', 0, '', false);
853
+        $this->pdf->textBox($x, $y + 3, $w - 2, $hLinha - 3, $this->textoAdic, $aFontTex, 'T', 'L', 0, '', false);
854 854
     }
855 855
     
856 856
     /**
@@ -876,7 +876,7 @@  discard block
 block discarded – undo
876 876
         if ($startPos === false) {
877 877
             return $cdata;
878 878
         }
879
-        for ($x=$len; $x>0; $x--) {
879
+        for ($x = $len; $x > 0; $x--) {
880 880
             if (substr($cdata, $x, 1) == '>') {
881 881
                 $endPos = $x;
882 882
                 break;
@@ -887,15 +887,15 @@  discard block
 block discarded – undo
887 887
         } else {
888 888
             $parte1 = '';
889 889
         }
890
-        $parte2 = substr($cdata, $startPos, $endPos-$startPos+1);
890
+        $parte2 = substr($cdata, $startPos, $endPos - $startPos + 1);
891 891
         if ($endPos < $len) {
892 892
             $parte3 = substr($cdata, $endPos + 1, $len - $endPos - 1);
893 893
         } else {
894 894
             $parte3 = '';
895 895
         }
896
-        $texto = trim($parte1).' '.trim($parte3);
896
+        $texto = trim($parte1) . ' ' . trim($parte3);
897 897
         if (strpos($parte2, '<CDATA>') === false) {
898
-            $cdata = '<CDATA>'.$parte2.'</CDATA>';
898
+            $cdata = '<CDATA>' . $parte2 . '</CDATA>';
899 899
         } else {
900 900
             $cdata = $parte2;
901 901
         }
@@ -967,15 +967,15 @@  discard block
 block discarded – undo
967 967
         //grupo CADATA infCpl
968 968
         $t = $dom->getElementsByTagName('transmissor')->item(0);
969 969
         $r = $dom->getElementsByTagName('receptor')->item(0);
970
-        $versao = ! empty($dom->getElementsByTagName('versao')->item(0)->nodeValue) ?
971
-        'Versao:'.$dom->getElementsByTagName('versao')->item(0)->nodeValue.' ' : '';
972
-        $especieNF = ! empty($dom->getElementsByTagName('especieNF')->item(0)->nodeValue) ?
973
-        'Especie:'.$dom->getElementsByTagName('especieNF')->item(0)->nodeValue.' ' : '';
974
-        $fabEntrega = ! empty($dom->getElementsByTagName('fabEntrega')->item(0)->nodeValue) ?
975
-        'Entrega:'.$dom->getElementsByTagName('fabEntrega')->item(0)->nodeValue.' ' : '';
976
-        $dca = ! empty($dom->getElementsByTagName('dca')->item(0)->nodeValue) ?
977
-        'dca:'.$dom->getElementsByTagName('dca')->item(0)->nodeValue.' ' : '';
978
-        $texto .= "".$versao.$especieNF.$fabEntrega.$dca;
970
+        $versao = !empty($dom->getElementsByTagName('versao')->item(0)->nodeValue) ?
971
+        'Versao:' . $dom->getElementsByTagName('versao')->item(0)->nodeValue . ' ' : '';
972
+        $especieNF = !empty($dom->getElementsByTagName('especieNF')->item(0)->nodeValue) ?
973
+        'Especie:' . $dom->getElementsByTagName('especieNF')->item(0)->nodeValue . ' ' : '';
974
+        $fabEntrega = !empty($dom->getElementsByTagName('fabEntrega')->item(0)->nodeValue) ?
975
+        'Entrega:' . $dom->getElementsByTagName('fabEntrega')->item(0)->nodeValue . ' ' : '';
976
+        $dca = !empty($dom->getElementsByTagName('dca')->item(0)->nodeValue) ?
977
+        'dca:' . $dom->getElementsByTagName('dca')->item(0)->nodeValue . ' ' : '';
978
+        $texto .= "" . $versao . $especieNF . $fabEntrega . $dca;
979 979
         if (isset($t)) {
980 980
             if ($t->hasAttributes()) {
981 981
                 $texto .= " Transmissor ";
Please login to merge, or discard this patch.
src/MDFe/Damdfe.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@
 block discarded – undo
26 26
     protected $yDados = 0;
27 27
     protected $xml; // string XML NFe
28 28
     protected $errMsg = ''; // mesagens de erro
29
-    protected $errStatus = false;// status de erro TRUE um erro ocorreu false sem erros
29
+    protected $errStatus = false; // status de erro TRUE um erro ocorreu false sem erros
30 30
     protected $formatoChave = "#### #### #### #### #### #### #### #### #### #### ####";
31 31
     protected $margemInterna = 2;
32 32
     protected $id;
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
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
             //ativar modo debug
110 110
             error_reporting(E_ALL);
111 111
             ini_set('display_errors', 'On');
112
-            set_error_handler(function (int $errnum, string $errmsg, string $errfile, int $errline) {
112
+            set_error_handler(function(int $errnum, string $errmsg, string $errfile, int $errline) {
113 113
                 throw new \Exception("Erro identificado $errnum: '$errmsg' $errfile [linha:" . $errline . "]");
114 114
             });
115 115
         } else {
@@ -258,7 +258,7 @@  discard block
 block discarded – undo
258 258
     {
259 259
         if (substr($logo, 0, 24) !== 'data://text/plain;base64') {
260 260
             if (is_file($logo)) {
261
-                $logo = 'data://text/plain;base64,'. base64_encode(file_get_contents($logo));
261
+                $logo = 'data://text/plain;base64,' . base64_encode(file_get_contents($logo));
262 262
             } else {
263 263
                 $logo = '';
264 264
             }
@@ -299,6 +299,6 @@  discard block
 block discarded – undo
299 299
         imagedestroy($image);
300 300
         $logo = ob_get_contents(); // read from buffer
301 301
         ob_end_clean();
302
-        return 'data://text/plain;base64,'.base64_encode($logo);
302
+        return 'data://text/plain;base64,' . base64_encode($logo);
303 303
     }
304 304
 }
Please login to merge, or discard this patch.