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:
commit
6cf10b4562
|
|
@ -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) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue