public function markTemporalVariablesIdle(CompilationContext $compilationContext)
{
$compilationContext = $compilationContext ?: $this->compilationContext;
$branchId = $compilationContext->branchManager->getCurrentBranchId();
if (!isset($this->branchTempVariables[$branchId])) {
return;
}
foreach ($this->branchTempVariables[$branchId] as $location => $typeVariables) {
foreach ($typeVariables as $type => $variables) {
foreach ($variables as $variable) {
$pos = strpos($variable->getName(), Variable::BRANCH_MAGIC);
$otherBranchId = 1;
if ($pos > -1) {
$otherBranchId = intval(substr($variable->getName(), $pos + strlen(Variable::BRANCH_MAGIC)));
}
if ($branchId == $otherBranchId) {
$variable->setIdle(true);
}
}
}
}
}