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

PDF::toPDFFile()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 1
dl 0
loc 4
rs 10
c 0
b 0
f 0
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
Best Practice introduced by
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