@@ -36,28 +36,28 @@ class Template
36
36
private $ zipClass ;
37
37
38
38
/**
39
- * Temporary file name
39
+ * Temporary file name.
40
40
*
41
41
* @var string
42
42
*/
43
43
private $ tempFileName ;
44
44
45
45
/**
46
- * Document XML
46
+ * Document XML.
47
47
*
48
48
* @var string
49
49
*/
50
50
private $ documentXML ;
51
51
52
52
/**
53
- * Document header XML
53
+ * Document header XML.
54
54
*
55
55
* @var string[]
56
56
*/
57
57
private $ headerXMLs = array ();
58
58
59
59
/**
60
- * Create a new Template Object
60
+ * Create a new Template Object.
61
61
*
62
62
* @since 0.12.0 Throws CreateTemporaryFileException and CopyFileException instead of Exception.
63
63
*
@@ -97,18 +97,19 @@ public function __construct($fileName)
97
97
}
98
98
99
99
/**
100
- * Document footer XML
100
+ * Document footer XML.
101
101
*
102
102
* @var string[]
103
103
*/
104
104
private $ footerXMLs = array ();
105
105
106
106
/**
107
- * Applies XSL style sheet to template's parts
107
+ * Applies XSL style sheet to template's parts.
108
108
*
109
109
* @param \DOMDocument $xslDOMDocument
110
110
* @param array $xslOptions
111
111
* @param string $xslOptionsURI
112
+ * @return void
112
113
* @throws \PhpOffice\PhpWord\Exception\Exception
113
114
*/
114
115
public function applyXslStyleSheet (&$ xslDOMDocument , $ xslOptions = array (), $ xslOptionsURI = '' )
@@ -135,11 +136,12 @@ public function applyXslStyleSheet(&$xslDOMDocument, $xslOptions = array(), $xsl
135
136
}
136
137
137
138
/**
138
- * Set a Template value
139
+ * Set a Template value.
139
140
*
140
141
* @param mixed $search
141
142
* @param mixed $replace
142
143
* @param integer $limit
144
+ * @return void
143
145
*/
144
146
public function setValue ($ search , $ replace , $ limit = -1 )
145
147
{
@@ -155,7 +157,8 @@ public function setValue($search, $replace, $limit = -1)
155
157
}
156
158
157
159
/**
158
- * Returns array of all variables in template
160
+ * Returns array of all variables in template.
161
+ *
159
162
* @return string[]
160
163
*/
161
164
public function getVariables ()
@@ -174,7 +177,7 @@ public function getVariables()
174
177
}
175
178
176
179
/**
177
- * Clone a table row in a template document
180
+ * Clone a table row in a template document.
178
181
*
179
182
* @param string $search
180
183
* @param integer $numberOfClones
@@ -230,7 +233,7 @@ public function cloneRow($search, $numberOfClones)
230
233
}
231
234
232
235
/**
233
- * Clone a block
236
+ * Clone a block.
234
237
*
235
238
* @param string $blockname
236
239
* @param integer $clones
@@ -266,10 +269,11 @@ public function cloneBlock($blockname, $clones = 1, $replace = true)
266
269
}
267
270
268
271
/**
269
- * Replace a block
272
+ * Replace a block.
270
273
*
271
274
* @param string $blockname
272
275
* @param string $replacement
276
+ * @return void
273
277
*/
274
278
public function replaceBlock ($ blockname , $ replacement )
275
279
{
@@ -289,17 +293,18 @@ public function replaceBlock($blockname, $replacement)
289
293
}
290
294
291
295
/**
292
- * Delete a block of text
296
+ * Delete a block of text.
293
297
*
294
298
* @param string $blockname
299
+ * @return void
295
300
*/
296
301
public function deleteBlock ($ blockname )
297
302
{
298
303
$ this ->replaceBlock ($ blockname , '' );
299
304
}
300
305
301
306
/**
302
- * Save XML to temporary file
307
+ * Save XML to temporary file.
303
308
*
304
309
* @return string
305
310
* @throws \PhpOffice\PhpWord\Exception\Exception
@@ -325,10 +330,12 @@ public function save()
325
330
}
326
331
327
332
/**
328
- * Save XML to defined name
333
+ * Save XML to defined name.
329
334
*
330
- * @param string $fileName
331
335
* @since 0.8.0
336
+ *
337
+ * @param string $fileName
338
+ * @return void
332
339
*/
333
340
public function saveAs ($ fileName )
334
341
{
@@ -375,7 +382,8 @@ protected function setValueForPart($documentPartXML, $search, $replace, $limit)
375
382
}
376
383
377
384
/**
378
- * Find all variables in $documentPartXML
385
+ * Find all variables in $documentPartXML.
386
+ *
379
387
* @param string $documentPartXML
380
388
* @return string[]
381
389
*/
@@ -387,7 +395,8 @@ protected function getVariablesForPart($documentPartXML)
387
395
}
388
396
389
397
/**
390
- * Get the name of the footer file for $index
398
+ * Get the name of the footer file for $index.
399
+ *
391
400
* @param integer $index
392
401
* @return string
393
402
*/
@@ -397,7 +406,8 @@ private function getFooterName($index)
397
406
}
398
407
399
408
/**
400
- * Get the name of the header file for $index
409
+ * Get the name of the header file for $index.
410
+ *
401
411
* @param integer $index
402
412
* @return string
403
413
*/
@@ -407,7 +417,7 @@ private function getHeaderName($index)
407
417
}
408
418
409
419
/**
410
- * Find the start position of the nearest table row before $offset
420
+ * Find the start position of the nearest table row before $offset.
411
421
*
412
422
* @param integer $offset
413
423
* @return integer
@@ -426,7 +436,7 @@ private function findRowStart($offset)
426
436
}
427
437
428
438
/**
429
- * Find the end position of the nearest table row after $offset
439
+ * Find the end position of the nearest table row after $offset.
430
440
*
431
441
* @param integer $offset
432
442
* @return integer
@@ -438,7 +448,7 @@ private function findRowEnd($offset)
438
448
}
439
449
440
450
/**
441
- * Get a slice of a string
451
+ * Get a slice of a string.
442
452
*
443
453
* @param integer $startPosition
444
454
* @param integer $endPosition
0 commit comments