| Conditions | 1 |
| Paths | 1 |
| Total Lines | 31 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 11 | protected function blocoVIII($y) |
||
| 12 | { |
||
| 13 | $this->bloco8H = 50; |
||
|
|
|||
| 14 | $y += 1; |
||
| 15 | |||
| 16 | /* |
||
| 17 | $aFont = ['font'=> $this->fontePadrao, 'size' => 7, 'style' => '']; |
||
| 18 | $this->pdf->textBox($this->margem, $y, $this->wPrint, $this->bloco8H, '', $aFont, 'T', 'C', true, '', false); |
||
| 19 | */ |
||
| 20 | |||
| 21 | $maxW = $this->wPrint; |
||
| 22 | $w = ($maxW*1)+4; |
||
| 23 | $barcode = new Barcode(); |
||
| 24 | $bobj = $barcode->getBarcodeObj( |
||
| 25 | 'QRCODE,M', |
||
| 26 | $this->qrCode, |
||
| 27 | -4, |
||
| 28 | -4, |
||
| 29 | 'black', |
||
| 30 | array(-2, -2, -2, -2) |
||
| 31 | )->setBackgroundColor('white'); |
||
| 32 | $qrcode = $bobj->getPngData(); |
||
| 33 | $wQr = 50; |
||
| 34 | $hQr = 50; |
||
| 35 | $yQr = ($y); |
||
| 36 | $xQr = ($w/2) - ($wQr/2); |
||
| 37 | $pic = 'data://text/plain;base64,' . base64_encode($qrcode); |
||
| 38 | $info = getimagesize($pic); |
||
| 39 | $this->pdf->image($pic, $xQr, $yQr, $wQr, $hQr, 'PNG'); |
||
| 40 | return $this->bloco8H+$y; |
||
| 41 | } |
||
| 42 | } |
||
| 43 |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: