1 | <?php |
||
11 | class Merger |
||
12 | { |
||
13 | /** |
||
14 | * List of pdf sources to merge |
||
15 | * |
||
16 | * @var SourceInterface[] |
||
17 | */ |
||
18 | private $sources = []; |
||
19 | |||
20 | /** |
||
21 | * @var Fpdi Fpdi object |
||
22 | */ |
||
23 | private $fpdi; |
||
24 | |||
25 | /** |
||
26 | * @var string Directory path used for temporary files |
||
27 | */ |
||
28 | private $tempDir; |
||
29 | |||
30 | /** |
||
31 | * Constructor |
||
32 | * |
||
33 | * @param Fpdi $fpdi |
||
34 | */ |
||
35 | public function __construct(Fpdi $fpdi = null) |
||
39 | |||
40 | /** |
||
41 | * Add raw PDF from string |
||
42 | * |
||
43 | * Note that your PDFs are merged in the order that you add them |
||
44 | * |
||
45 | * @param string $content Raw pdf content |
||
46 | * @param Pages $pages Specification of the pages to add |
||
47 | * @return void |
||
48 | */ |
||
49 | public function addRaw($content, Pages $pages = null) |
||
53 | |||
54 | /** |
||
55 | * Add PDF from file |
||
56 | * |
||
57 | * Note that your PDFs are merged in the order that you add them |
||
58 | * |
||
59 | * @param string $filename Name of file to add |
||
60 | * @param Pages $pages Pages to add from file |
||
61 | * @return void |
||
62 | * @throws Exception If $filename is not a valid file |
||
63 | */ |
||
64 | public function addFile($filename, Pages $pages = null) |
||
73 | |||
74 | /** |
||
75 | * Add PDF from file |
||
76 | * |
||
77 | * @deprecated Since version 3.1 |
||
78 | */ |
||
79 | public function addFromFile($fname, Pages $pages = null, $cleanup = null) |
||
84 | |||
85 | /** |
||
86 | * Add files using iterator |
||
87 | * |
||
88 | * @param iterable $iterator Iterator or array with names of files to merge |
||
89 | * @param Pages $pages Optional pages constraint used for every added pdf |
||
90 | * @return void |
||
91 | * @throws Exception If $iterator is not valid |
||
92 | */ |
||
93 | public function addIterator($iterator, Pages $pages = null) |
||
103 | |||
104 | /** |
||
105 | * Add files using a symfony finder |
||
106 | * |
||
107 | * @param Finder $finder |
||
108 | * @param Pages $pages Optional pages constraint used for every added pdf |
||
109 | * @return void |
||
110 | */ |
||
111 | public function addFinder(Finder $finder, Pages $pages = null) |
||
117 | |||
118 | /** |
||
119 | * Merges your provided PDFs and get raw string |
||
120 | * |
||
121 | * @return string |
||
122 | * @throws Exception If no PDFs were added |
||
123 | * @throws Exception If a specified page does not exist |
||
124 | * |
||
125 | * @TODO Should $sources be emptied after a merge? Why not implement a clear() method instead? |
||
126 | */ |
||
127 | public function merge() |
||
168 | |||
169 | /** |
||
170 | * Create temporary file and return name |
||
171 | * |
||
172 | * @deprecated Since version 3.1 |
||
173 | */ |
||
174 | public function getTempFname() |
||
183 | |||
184 | /** |
||
185 | * Get directory path for temporary files |
||
186 | * |
||
187 | * @deprecated Since version 3.1 |
||
188 | */ |
||
189 | public function getTempDir() |
||
198 | |||
199 | /** |
||
200 | * Set directory path for temporary files |
||
201 | * |
||
202 | * @deprecated Since version 3.1 |
||
203 | */ |
||
204 | public function setTempDir($dirname) |
||
213 | } |
||
214 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.