BurningFlipside /
CommonCode
These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
| 1 | <?php |
||
| 2 | namespace PDF; |
||
| 3 | |||
| 4 | require(dirname(__FILE__).'/../vendor/autoload.php'); |
||
| 5 | |||
| 6 | class PDF |
||
| 7 | { |
||
| 8 | private $mpdf; |
||
| 9 | |||
| 10 | function __construct() |
||
|
0 ignored issues
–
show
|
|||
| 11 | { |
||
| 12 | $this->mpdf = new \Mpdf\Mpdf(); |
||
| 13 | } |
||
| 14 | |||
| 15 | public function setPDFFromHTML($html) |
||
| 16 | { |
||
| 17 | $this->mpdf->WriteHTML($html); |
||
| 18 | } |
||
| 19 | |||
| 20 | public function toPDFBuffer() |
||
| 21 | { |
||
| 22 | return $this->mpdf->Output('', 'S'); |
||
| 23 | } |
||
| 24 | |||
| 25 | public function toPDFFile($filename) |
||
| 26 | { |
||
| 27 | return $this->mpdf->Output($filename); |
||
| 28 | } |
||
| 29 | } |
||
| 30 |
Adding explicit visibility (
private,protected, orpublic) is generally recommend to communicate to other developers how, and from where this method is intended to be used.