Skip to content

Commit 6cf10b4

Browse files
authored
Merge pull request #1161 from abcdmitry/patch-1
Get rid of duplicated code in TemplateProcessor call static methods with static:: instead of self::
2 parents c9b19cf + ba9e895 commit 6cf10b4

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/PhpWord/TemplateProcessor.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -244,10 +244,10 @@ public function setValue($search, $replace, $limit = self::MAXIMUM_REPLACEMENTS_
244244
{
245245
if (is_array($search)) {
246246
foreach ($search as &$item) {
247-
$item = self::ensureMacroCompleted($item);
247+
$item = static::ensureMacroCompleted($item);
248248
}
249249
} else {
250-
$search = self::ensureMacroCompleted($search);
250+
$search = static::ensureMacroCompleted($search);
251251
}
252252

253253
if (is_array($replace)) {
@@ -582,9 +582,7 @@ public function getVariables()
582582
*/
583583
public function cloneRow($search, $numberOfClones)
584584
{
585-
if ('${' !== substr($search, 0, 2) && '}' !== substr($search, -1)) {
586-
$search = '${' . $search . '}';
587-
}
585+
$search = static::ensureMacroCompleted($search);
588586

589587
$tagPos = strpos($this->tempDocumentMainPart, $search);
590588
if (!$tagPos) {

0 commit comments

Comments
 (0)