protected function purgeScope($scope)
{
foreach ($scope as $name => $obj) {
if ($obj instanceof Generic) {
if ($obj->source === 'config' && $obj->revision < $this->revision) {
if (!$obj->resetToDefault()) {
unset($scope->{$name});
}
}
} elseif ($obj instanceof Section) {
if ($obj->source === 'config' && $obj->revision < $this->revision) {
if ($obj->count() === 0) {
unset($scope->{$name});
} elseif (isset($obj->enable)) {
$obj->enable->setValue(false);
}
}
}
}
}