private function processAndMergeNewVars(&$input)
{
foreach ($input['newVars'] as $key => $newVar) {
if ($newVar['varName'] == '' || $newVar['classPath'] == '' || $newVar['methodName'] == '') {
unset($input['newVars'][$key]);
}
}
// merge newVars array into vars array
if (count($input['newVars'])) {
$input['vars'] = array_get($input, 'vars', []) + $input['newVars'];
}
// remove the newVars key from template
unset($input['newVars']);
}