22
22
class HtmlDocument implements HtmlDocumentInterface
23
23
{
24
24
private string $ htmlContents ;
25
- private string $ pdfBackgroundFile = '' ;
26
- private string $ pdfBackgroundFileForFirstPage = '' ;
25
+ private ? string $ pdfBackgroundFile = null ;
26
+ private ? string $ pdfBackgroundFileForFirstPage = null ;
27
27
28
- public function setHtmlContents (string $ htmlContents): self
28
+ public function __construct (string $ htmlContents, ? string $ pdfBackgroundFile = null , ? string $ pdfBackgroundFileForFirstPage = null )
29
29
{
30
30
$ this ->htmlContents = $ htmlContents ;
31
-
32
- return $ this ;
31
+ $ this -> pdfBackgroundFile = $ pdfBackgroundFile ;
32
+ $ this -> pdfBackgroundFileForFirstPage = $ pdfBackgroundFileForFirstPage ;
33
33
}
34
34
35
35
public function getHtmlContents (): string
36
36
{
37
37
return $ this ->htmlContents ;
38
38
}
39
39
40
- public function getPdfBackgroundFile (): string
40
+ public function getPdfBackgroundFile (): ? string
41
41
{
42
42
return $ this ->pdfBackgroundFile ;
43
43
}
@@ -47,7 +47,7 @@ public function setPdfBackgroundFile(string $pdfBackgroundFile): void
47
47
$ this ->pdfBackgroundFile = $ pdfBackgroundFile ;
48
48
}
49
49
50
- public function getPdfBackgroundFileForFirstPage (): string
50
+ public function getPdfBackgroundFileForFirstPage (): ? string
51
51
{
52
52
return $ this ->pdfBackgroundFileForFirstPage ;
53
53
}
@@ -56,9 +56,4 @@ public function setPdfBackgroundFileForFirstPage(string $pdfBackgroundFileForFir
56
56
{
57
57
$ this ->pdfBackgroundFileForFirstPage = $ pdfBackgroundFileForFirstPage ;
58
58
}
59
-
60
- public function getDocumentType (): string
61
- {
62
- return '' ;
63
- }
64
59
}
0 commit comments