private function &navigateToKey($key, $createSections)
{
$current =& $this->array;
foreach (explode('.', $key) as $key) {
if (!is_array($current)) {
if ($createSections) {
$current = [];
} else {
throw new BadConfigKeyException('Trying to access child of a scalar value: ' . $key);
}
}
if (!isset($current[$this->normalizeKey($key)])) {
if ($createSections) {
$current[$this->normalizeKey($key)] = [];
} else {
throw new BadConfigKeyException('Trying to access a node that doesn\'t exist: ' . $key);
}
}
$current =& $current[$this->normalizeKey($key)];
}
return $current;
}