Passed
Pull Request — master (#453)
by
unknown
03:26
created
src/NFe/DanfeSimples.php 3 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -193,6 +193,9 @@
 block discarded – undo
193 193
         $this->orientacao = $orientacao;
194 194
     }
195 195
 
196
+    /**
197
+     * @param string $xml
198
+     */
196 199
     private function loadDoc($xml)
197 200
     {
198 201
         $this->xml = $xml;
Please login to merge, or discard this patch.
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -286,7 +286,7 @@  discard block
 block discarded – undo
286 286
             $c1,
287 287
             5,
288 288
             "{$this->nfeArray['NFe']['infNFe']['ide']['tpNF']} - " .
289
-                                  ($this->nfeArray['NFe']['infNFe']['ide']['tpNF']==1 ? 'Saida':'Entrada'),
289
+                                    ($this->nfeArray['NFe']['infNFe']['ide']['tpNF']==1 ? 'Saida':'Entrada'),
290 290
             1,
291 291
             0,
292 292
             'C',
@@ -370,8 +370,8 @@  discard block
 block discarded – undo
370 370
         );
371 371
 
372 372
         $enderecoEmit  = "{$this->nfeArray['NFe']['infNFe']['emit']['enderEmit']['xMun']}"
373
-                       . " / {$this->nfeArray['NFe']['infNFe']['emit']['enderEmit']['UF']}"
374
-                       . " - CEP {$this->nfeArray['NFe']['infNFe']['emit']['enderEmit']['CEP']}";
373
+                        . " / {$this->nfeArray['NFe']['infNFe']['emit']['enderEmit']['UF']}"
374
+                        . " - CEP {$this->nfeArray['NFe']['infNFe']['emit']['enderEmit']['CEP']}";
375 375
 
376 376
         // LINHA 9
377 377
         $this->pdf->setFont('Arial', '', $pequeno ? 9 : 10);
@@ -417,8 +417,8 @@  discard block
 block discarded – undo
417 417
                 $enderecoLinha2 .= "{$this->nfeArray['NFe']['infNFe']['entrega']['xCpl']} - ";
418 418
             }
419 419
             $enderecoLinha2 .= "{$this->nfeArray['NFe']['infNFe']['entrega']['xMun']}"
420
-                             . " / {$this->nfeArray['NFe']['infNFe']['entrega']['UF']}"
421
-                             . " - CEP {$this->nfeArray['NFe']['infNFe']['entrega']['CEP']}";
420
+                                . " / {$this->nfeArray['NFe']['infNFe']['entrega']['UF']}"
421
+                                . " - CEP {$this->nfeArray['NFe']['infNFe']['entrega']['CEP']}";
422 422
         } else {
423 423
             $enderecoLinha1 = "{$this->nfeArray['NFe']['infNFe']['dest']['enderDest']['xLgr']}";
424 424
             if (!empty($this->nfeArray['NFe']['infNFe']['dest']['enderDest']['nro'])) {
@@ -429,8 +429,8 @@  discard block
 block discarded – undo
429 429
                 $enderecoLinha2 .= "{$this->nfeArray['NFe']['infNFe']['dest']['enderDest']['xCpl']} - ";
430 430
             }
431 431
             $enderecoLinha2 .= "{$this->nfeArray['NFe']['infNFe']['dest']['enderDest']['xMun']}"
432
-                             . " / {$this->nfeArray['NFe']['infNFe']['dest']['enderDest']['UF']}"
433
-                             . " - CEP {$this->nfeArray['NFe']['infNFe']['dest']['enderDest']['CEP']}";
432
+                                . " / {$this->nfeArray['NFe']['infNFe']['dest']['enderDest']['UF']}"
433
+                                . " - CEP {$this->nfeArray['NFe']['infNFe']['dest']['enderDest']['CEP']}";
434 434
         }
435 435
 
436 436
         // LINHA 13
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -286,7 +286,7 @@  discard block
 block discarded – undo
286 286
             $c1,
287 287
             5,
288 288
             "{$this->nfeArray['NFe']['infNFe']['ide']['tpNF']} - " .
289
-                                  ($this->nfeArray['NFe']['infNFe']['ide']['tpNF']==1 ? 'Saida':'Entrada'),
289
+                                  ($this->nfeArray['NFe']['infNFe']['ide']['tpNF'] == 1 ? 'Saida' : 'Entrada'),
290 290
             1,
291 291
             0,
292 292
             'C',
@@ -337,7 +337,7 @@  discard block
 block discarded – undo
337 337
             //que uma impressora de 203dpi consiga imprimir um código legível
338 338
             $this->pdf->code128($this->margesq * 2, $y, $chave, ($this->maxW - $this->margesq * 4), 15);
339 339
         } else {
340
-            $this->pdf->code128(($c1/2), $y, $chave, ($c1 * 3), 15);
340
+            $this->pdf->code128(($c1 / 2), $y, $chave, ($c1 * 3), 15);
341 341
         }
342 342
         $this->pdf->setFillColor(255, 255, 255);
343 343
         $this->pdf->ln();
@@ -369,7 +369,7 @@  discard block
 block discarded – undo
369 369
             1
370 370
         );
371 371
 
372
-        $enderecoEmit  = "{$this->nfeArray['NFe']['infNFe']['emit']['enderEmit']['xMun']}"
372
+        $enderecoEmit = "{$this->nfeArray['NFe']['infNFe']['emit']['enderEmit']['xMun']}"
373 373
                        . " / {$this->nfeArray['NFe']['infNFe']['emit']['enderEmit']['UF']}"
374 374
                        . " - CEP {$this->nfeArray['NFe']['infNFe']['emit']['enderEmit']['CEP']}";
375 375
 
Please login to merge, or discard this patch.
src/NFe/Traits/TraitBlocoIX.php 2 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -7,6 +7,9 @@
 block discarded – undo
7 7
  */
8 8
 trait TraitBlocoIX
9 9
 {
10
+    /**
11
+     * @param integer $y
12
+     */
10 13
     protected function blocoIX($y)
11 14
     {
12 15
         $aFont = ['font'=> $this->fontePadrao, 'size' => 7, 'style' => ''];
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -33,9 +33,9 @@  discard block
 block discarded – undo
33 33
         }
34 34
         $this->pdf->textBox(
35 35
             $this->margem,
36
-            $y+3,
36
+            $y + 3,
37 37
             $this->wPrint,
38
-            $this->bloco9H-4,
38
+            $this->bloco9H - 4,
39 39
             str_replace(";", "\n", $this->infCpl),
40 40
             $aFont,
41 41
             'T',
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
             $aFont = ['font'=> $this->fontePadrao, 'size' => 5, 'style' => ''];
68 68
         }
69 69
         $linhas = str_replace(';', "\n", $this->infCpl);
70
-        $hfont = (imagefontheight($fsize)/72)*13;
70
+        $hfont = (imagefontheight($fsize) / 72) * 13;
71 71
         $numlinhas = $pdf->getNumLines($linhas, $wprint, $aFont);
72 72
         return (int) ($numlinhas * $hfont) + 2;
73 73
     }
Please login to merge, or discard this patch.
src/NFe/Traits/TraitBlocoX.php 1 patch
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -7,6 +7,9 @@
 block discarded – undo
7 7
  */
8 8
 trait TraitBlocoX
9 9
 {
10
+    /**
11
+     * @param double $y
12
+     */
10 13
     protected function blocoX($y)
11 14
     {
12 15
         //$this->bloco9H = 3;
Please login to merge, or discard this patch.
src/Legacy/Common.php 1 patch
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -222,6 +222,9 @@
 block discarded – undo
222 222
         }
223 223
     }
224 224
 
225
+    /**
226
+     * @param string $tPag
227
+     */
225 228
     protected function tipoPag($tPag)
226 229
     {
227 230
         switch ($tPag) {
Please login to merge, or discard this patch.
src/NFe/Traits/TraitBlocoVII.php 1 patch
Spacing   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -40,8 +40,8 @@  discard block
 block discarded – undo
40 40
             $subSize = 1.5;
41 41
         }
42 42
         if ($this->tpEmis == 9) {
43
-            $aFont = ['font'=> $this->fontePadrao, 'size' => (7-$subSize), 'style' => ''];
44
-            $y += 2*$yPlus;
43
+            $aFont = ['font'=> $this->fontePadrao, 'size' => (7 - $subSize), 'style' => ''];
44
+            $y += 2 * $yPlus;
45 45
             $y1 = $this->pdf->textBox(
46 46
                 $this->margem,
47 47
                 $y,
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
                 false
57 57
             );
58 58
         
59
-            $y1 += 2*$yPlus;
59
+            $y1 += 2 * $yPlus;
60 60
             $num = str_pad($this->getTagValue($this->ide, "nNF"), 9, '0', STR_PAD_LEFT);
61 61
             $serie = str_pad($this->getTagValue($this->ide, "serie"), 3, '0', STR_PAD_LEFT);
62 62
             $data = (new \DateTime($this->getTagValue($this->ide, "dhEmi")))->format('d/m/Y H:i:s');
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
             $aFont = ['font'=> $this->fontePadrao, 'size' => 8, 'style' => 'B'];
65 65
             $y2 = $this->pdf->textBox(
66 66
                 $this->margem,
67
-                $y+$y1,
67
+                $y + $y1,
68 68
                 $this->wPrint,
69 69
                 4,
70 70
                 $texto,
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
             $texto = $this->via;
80 80
             $y3 = $this->pdf->textBox(
81 81
                 $this->margem,
82
-                $y+$y1+$y2,
82
+                $y + $y1 + $y2,
83 83
                 $this->wPrint,
84 84
                 4,
85 85
                 $texto,
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
             $aFont = ['font'=> $this->fontePadrao, 'size' => 10, 'style' => 'B'];
97 97
             $y4 = $this->pdf->textBox(
98 98
                 $this->margem,
99
-                $y+$y1+$y2+$y3,
99
+                $y + $y1 + $y2 + $y3,
100 100
                 $this->wPrint,
101 101
                 4,
102 102
                 $texto,
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
             $aFont = ['font'=> $this->fontePadrao, 'size' => 8, 'style' => 'I'];
113 113
             $y5 = $this->pdf->textBox(
114 114
                 $this->margem,
115
-                $y+$y1+$y2+$y3+$y4,
115
+                $y + $y1 + $y2 + $y3 + $y4,
116 116
                 $this->wPrint,
117 117
                 3,
118 118
                 $texto,
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
             $aFont = ['font'=> $this->fontePadrao, 'size' => 7, 'style' => ''];
128 128
             $y1 = $this->pdf->textBox(
129 129
                 $this->margem,
130
-                $y+1,
130
+                $y + 1,
131 131
                 $this->wPrint,
132 132
                 $this->bloco7H,
133 133
                 $texto,
@@ -143,10 +143,10 @@  discard block
 block discarded – undo
143 143
             $serie = str_pad($this->getTagValue($this->ide, "serie"), 3, '0', STR_PAD_LEFT);
144 144
             $data = (new \DateTime($this->getTagValue($this->ide, "dhEmi")))->format('d/m/Y H:i:s');
145 145
             $texto = "NFCe n. {$num} Série {$serie} {$data}";
146
-            $aFont = ['font'=> $this->fontePadrao, 'size' => (8-$subSize), 'style' => ''];
146
+            $aFont = ['font'=> $this->fontePadrao, 'size' => (8 - $subSize), 'style' => ''];
147 147
             $y2 = $this->pdf->textBox(
148 148
                 $this->margem,
149
-                $y+1+$y1,
149
+                $y + 1 + $y1,
150 150
                 $this->wPrint,
151 151
                 4,
152 152
                 $texto,
@@ -158,10 +158,10 @@  discard block
 block discarded – undo
158 158
                 true
159 159
             );
160 160
             $texto = "DANFE-NFC-e Impresso em contingência - EPEC";
161
-            $aFont = ['font'=> $this->fontePadrao, 'size' => (10-$subSize), 'style' => 'B'];
161
+            $aFont = ['font'=> $this->fontePadrao, 'size' => (10 - $subSize), 'style' => 'B'];
162 162
             $y2 = $this->pdf->textBox(
163 163
                 $this->margem,
164
-                $y+1+$y1+3,
164
+                $y + 1 + $y1 + 3,
165 165
                 $this->wPrint,
166 166
                 4,
167 167
                 $texto,
@@ -174,10 +174,10 @@  discard block
 block discarded – undo
174 174
             );
175 175
             
176 176
             $texto = "Regularmente recebido pela administração tributária autorizadora";
177
-            $aFont = ['font'=> $this->fontePadrao, 'size' => (8-$subSize), 'style' => ''];
177
+            $aFont = ['font'=> $this->fontePadrao, 'size' => (8 - $subSize), 'style' => ''];
178 178
             $y2 = $this->pdf->textBox(
179 179
                 $this->margem,
180
-                $y+1+$y1+$y2+3,
180
+                $y + 1 + $y1 + $y2 + 3,
181 181
                 $this->wPrint,
182 182
                 4,
183 183
                 $texto,
@@ -192,10 +192,10 @@  discard block
 block discarded – undo
192 192
                 $dhCont = $this->dom->getElementsByTagName('dhCont')->item(0)->nodeValue;
193 193
                 $dt = \DateTime::createFromFormat('Y-m-d\TH:i:sP', $dhCont);
194 194
                 $texto = "Data de entrada em contingência : " . $dt->format('d/m/Y H:i:s');
195
-                $aFont = ['font'=> $this->fontePadrao, 'size' => (7-$subSize), 'style' => ''];
195
+                $aFont = ['font'=> $this->fontePadrao, 'size' => (7 - $subSize), 'style' => ''];
196 196
                 $y2 = $this->pdf->textBox(
197 197
                     $this->margem,
198
-                    $y+1+$y1+$y2+6,
198
+                    $y + 1 + $y1 + $y2 + 6,
199 199
                     $this->wPrint,
200 200
                     4,
201 201
                     $texto,
@@ -211,7 +211,7 @@  discard block
 block discarded – undo
211 211
             $aFont = ['font'=> $this->fontePadrao, 'size' => 7, 'style' => ''];
212 212
             $y1 = $this->pdf->textBox(
213 213
                 $this->margem,
214
-                $y+1,
214
+                $y + 1,
215 215
                 $this->wPrint,
216 216
                 $this->bloco7H,
217 217
                 $texto,
@@ -227,10 +227,10 @@  discard block
 block discarded – undo
227 227
             $serie = str_pad($this->getTagValue($this->ide, "serie"), 3, '0', STR_PAD_LEFT);
228 228
             $data = (new \DateTime($this->getTagValue($this->ide, "dhEmi")))->format('d/m/Y H:i:s');
229 229
             $texto = "NFCe n. {$num} Série {$serie} {$data}";
230
-            $aFont = ['font'=> $this->fontePadrao, 'size' => (8-$subSize), 'style' => 'B'];
230
+            $aFont = ['font'=> $this->fontePadrao, 'size' => (8 - $subSize), 'style' => 'B'];
231 231
             $y2 = $this->pdf->textBox(
232 232
                 $this->margem,
233
-                $y+1+$y1,
233
+                $y + 1 + $y1,
234 234
                 $this->wPrint,
235 235
                 4,
236 236
                 $texto,
@@ -250,10 +250,10 @@  discard block
 block discarded – undo
250 250
             }
251 251
             
252 252
             $texto = "Protocolo de Autorização:  {$protocolo}";
253
-            $aFont = ['font'=> $this->fontePadrao, 'size' => (8-$subSize), 'style' => ''];
253
+            $aFont = ['font'=> $this->fontePadrao, 'size' => (8 - $subSize), 'style' => ''];
254 254
             $y3 = $this->pdf->textBox(
255 255
                 $this->margem,
256
-                $y+1+$y1+$y2,
256
+                $y + 1 + $y1 + $y2,
257 257
                 $this->wPrint,
258 258
                 4,
259 259
                 $texto,
@@ -266,10 +266,10 @@  discard block
 block discarded – undo
266 266
             );
267 267
             
268 268
             $texto = "Data de Autorização:  {$data}";
269
-            $aFont = ['font'=> $this->fontePadrao, 'size' => (8-$subSize), 'style' => ''];
269
+            $aFont = ['font'=> $this->fontePadrao, 'size' => (8 - $subSize), 'style' => ''];
270 270
             $y4 = $this->pdf->textBox(
271 271
                 $this->margem,
272
-                $y+1+$y1+$y2+$y3,
272
+                $y + 1 + $y1 + $y2 + $y3,
273 273
                 $this->wPrint,
274 274
                 4,
275 275
                 $texto,
@@ -281,7 +281,7 @@  discard block
 block discarded – undo
281 281
                 true
282 282
             );
283 283
         }
284
-        $this->pdf->dashedHLine($this->margem, $this->bloco7H+$y, $this->wPrint, 0.1, 30);
284
+        $this->pdf->dashedHLine($this->margem, $this->bloco7H + $y, $this->wPrint, 0.1, 30);
285 285
         return $this->bloco7H + $y;
286 286
     }
287 287
 }
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
@@ -28,13 +28,13 @@  discard block
 block discarded – undo
28 28
             $xImg = $this->margem;
29 29
             $yImg = $this->margem + 1;
30 30
             $logoInfo = getimagesize($this->logomarca);
31
-            $logoWmm = ($logoInfo[0]/72)*25.4;
32
-            $logoHmm = ($logoInfo[1]/72)*25.4;
33
-            $nImgW = $this->wPrint/4;
34
-            $nImgH = round($logoHmm * ($nImgW/$logoWmm), 0);
31
+            $logoWmm = ($logoInfo[0] / 72) * 25.4;
32
+            $logoHmm = ($logoInfo[1] / 72) * 25.4;
33
+            $nImgW = $this->wPrint / 4;
34
+            $nImgH = round($logoHmm * ($nImgW / $logoWmm), 0);
35 35
             if ($nImgH > $maxHimg) {
36 36
                 $nImgH = $maxHimg;
37
-                $nImgW = round($logoWmm * ($nImgH/$logoHmm), 0);
37
+                $nImgW = round($logoWmm * ($nImgH / $logoHmm), 0);
38 38
             }
39 39
             $xRs = ($nImgW) + $this->margem;
40 40
             $wRs = ($this->wPrint - $nImgW);
@@ -49,10 +49,10 @@  discard block
 block discarded – undo
49 49
         $aFont = ['font'=>$this->fontePadrao, 'size' => 8, 'style' => ''];
50 50
         $texto = "{$emitRazao}";
51 51
         $y += $this->pdf->textBox(
52
-            $xRs+2,
52
+            $xRs + 2,
53 53
             $this->margem,
54
-            $wRs-2,
55
-            $this->bloco1H-$this->margem-1,
54
+            $wRs - 2,
55
+            $this->bloco1H - $this->margem - 1,
56 56
             $texto,
57 57
             $aFont,
58 58
             'T',
@@ -65,13 +65,13 @@  discard block
 block discarded – undo
65 65
             $aFont = ['font'=>$this->fontePadrao, 'size' => $this->pdf->fontSizePt, 'style' => ''];
66 66
         }
67 67
         $texto = "CNPJ: {$emitCnpj} IE: {$emitIE}";
68
-        $y += $this->pdf->textBox($xRs+2, $y, $wRs-2, 3, $texto, $aFont, 'T', $alignH, false, '', true);
68
+        $y += $this->pdf->textBox($xRs + 2, $y, $wRs - 2, 3, $texto, $aFont, 'T', $alignH, false, '', true);
69 69
         $texto = $emitLgr . ", " . $emitNro;
70
-        $y += $this->pdf->textBox($xRs+2, $y, $wRs-2, 3, $texto, $aFont, 'T', $alignH, false, '', true);
70
+        $y += $this->pdf->textBox($xRs + 2, $y, $wRs - 2, 3, $texto, $aFont, 'T', $alignH, false, '', true);
71 71
         $texto = $emitBairro;
72
-        $y += $this->pdf->textBox($xRs+2, $y, $wRs-2, 3, $texto, $aFont, 'T', $alignH, false, '', true);
72
+        $y += $this->pdf->textBox($xRs + 2, $y, $wRs - 2, 3, $texto, $aFont, 'T', $alignH, false, '', true);
73 73
         $texto = $emitMun . "-" . $emitUF;
74
-        $y += $this->pdf->textBox($xRs+2, $y, $wRs-2, 3, $texto, $aFont, 'T', $alignH, false, '', true);
74
+        $y += $this->pdf->textBox($xRs + 2, $y, $wRs - 2, 3, $texto, $aFont, 'T', $alignH, false, '', true);
75 75
         $this->pdf->dashedHLine($this->margem, $this->bloco1H + ($this->fontePadrao == 'arial' ? 1 : 0), $this->wPrint, 0.1, 30);
76 76
         return $this->bloco1H;
77 77
     }
Please login to merge, or discard this patch.