Skip to content

Commit b7387be

Browse files
author
Roman Syroeshko
committed
Reimplemented #498.
1 parent a5c3645 commit b7387be

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ This is the changelog between releases of PHPWord. Releases are listed in revers
99
Place announcement text here.
1010

1111
### Changes
12+
- Changed visibility of all private properties and methods of ``TemplateProcessor`` to ``protected``. - RomanSyroeshko #498
1213
- Improved performance of ``TemplateProcessor::setValue()``. - @RomanSyroeshko #513
1314
- Renamed ``align`` option of ``Paragraph`` style into ``alignment``. Note: accessor and mutator methods are renamed too. - @RomanSyroeshko
1415

src/PhpWord/TemplateProcessor.php

+10-10
Original file line numberDiff line numberDiff line change
@@ -30,33 +30,33 @@ class TemplateProcessor
3030
*
3131
* @var mixed
3232
*/
33-
private $zipClass;
33+
protected $zipClass;
3434

3535
/**
3636
* @var string Temporary document filename (with path).
3737
*/
38-
private $temporaryDocumentFilename;
38+
protected $temporaryDocumentFilename;
3939

4040
/**
4141
* Content of main document part (in XML format) of the temporary document.
4242
*
4343
* @var string
4444
*/
45-
private $temporaryDocumentMainPart;
45+
protected $temporaryDocumentMainPart;
4646

4747
/**
4848
* Content of headers (in XML format) of the temporary document.
4949
*
5050
* @var string[]
5151
*/
52-
private $temporaryDocumentHeaders = array();
52+
protected $temporaryDocumentHeaders = array();
5353

5454
/**
5555
* Content of footers (in XML format) of the temporary document.
5656
*
5757
* @var string[]
5858
*/
59-
private $temporaryDocumentFooters = array();
59+
protected $temporaryDocumentFooters = array();
6060

6161
/**
6262
* @since 0.12.0 Throws CreateTemporaryFileException and CopyFileException instead of Exception.
@@ -410,7 +410,7 @@ protected function getVariablesForPart($documentPartXML)
410410
* @param integer $index
411411
* @return string
412412
*/
413-
private function getFooterName($index)
413+
protected function getFooterName($index)
414414
{
415415
return sprintf('word/footer%d.xml', $index);
416416
}
@@ -421,7 +421,7 @@ private function getFooterName($index)
421421
* @param integer $index
422422
* @return string
423423
*/
424-
private function getHeaderName($index)
424+
protected function getHeaderName($index)
425425
{
426426
return sprintf('word/header%d.xml', $index);
427427
}
@@ -433,7 +433,7 @@ private function getHeaderName($index)
433433
* @return integer
434434
* @throws \PhpOffice\PhpWord\Exception\Exception
435435
*/
436-
private function findRowStart($offset)
436+
protected function findRowStart($offset)
437437
{
438438
$rowStart = strrpos($this->temporaryDocumentMainPart, '<w:tr ', ((strlen($this->temporaryDocumentMainPart) - $offset) * -1));
439439

@@ -453,7 +453,7 @@ private function findRowStart($offset)
453453
* @param integer $offset
454454
* @return integer
455455
*/
456-
private function findRowEnd($offset)
456+
protected function findRowEnd($offset)
457457
{
458458
return strpos($this->temporaryDocumentMainPart, '</w:tr>', $offset) + 7;
459459
}
@@ -465,7 +465,7 @@ private function findRowEnd($offset)
465465
* @param integer $endPosition
466466
* @return string
467467
*/
468-
private function getSlice($startPosition, $endPosition = 0)
468+
protected function getSlice($startPosition, $endPosition = 0)
469469
{
470470
if (!$endPosition) {
471471
$endPosition = strlen($this->temporaryDocumentMainPart);

0 commit comments

Comments
 (0)