Completed
Pull Request — develop (#89)
by Patrick
11:08 queued 08:06
created

PDF/class.PDF.php (1 issue)

Severity

Upgrade to new PHP Analysis Engine

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
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
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