Merge pull request #1161 from abcdmitry/patch-1

Get rid of duplicated code in TemplateProcessor
call static methods with static:: instead of self::
This commit is contained in:
troosan 2018-12-26 20:04:18 +01:00 committed by GitHub
commit 6cf10b4562
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 5 deletions

View File

@ -244,10 +244,10 @@ class TemplateProcessor
{ {
if (is_array($search)) { if (is_array($search)) {
foreach ($search as &$item) { foreach ($search as &$item) {
$item = self::ensureMacroCompleted($item); $item = static::ensureMacroCompleted($item);
} }
} else { } else {
$search = self::ensureMacroCompleted($search); $search = static::ensureMacroCompleted($search);
} }
if (is_array($replace)) { if (is_array($replace)) {
@ -582,9 +582,7 @@ class TemplateProcessor
*/ */
public function cloneRow($search, $numberOfClones) public function cloneRow($search, $numberOfClones)
{ {
if ('${' !== substr($search, 0, 2) && '}' !== substr($search, -1)) { $search = static::ensureMacroCompleted($search);
$search = '${' . $search . '}';
}
$tagPos = strpos($this->tempDocumentMainPart, $search); $tagPos = strpos($this->tempDocumentMainPart, $search);
if (!$tagPos) { if (!$tagPos) {