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

PDF   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
dl 0
loc 24
rs 10
c 0
b 0
f 0
wmc 4
lcom 1
cbo 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A setPDFFromHTML() 0 4 1
A toPDFBuffer() 0 4 1
A toPDFFile() 0 4 1
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