protected function _flushVariables($node)
{
if (!$this->_variables[$this->_depth]) {
return;
}
$body = '';
foreach ($this->_variables[$this->_depth] as $variable) {
if ($variable['isClass']) {
$body .= $variable['name'] . '__=null;';
}
$body .= $variable['name'] . $variable['patch'];
}
if (!$node->inPhp) {
$body = '<?php ' . $body . ' ?>';
}
$patch = new NodeDef($body, 'code');
$patch->parent = $node;
$patch->function = $node->function;
$patch->namespace = $node->namespace;
array_unshift($node->tree, $patch);
$this->_variables[$this->_depth] = [];
}