Commit d8dc1a0c authored by xjm's avatar xjm
Browse files

Issue #2924683 by kiamlaluno: Variable is uselessly initialized three times

parent 38745547
......@@ -48,30 +48,26 @@ public function get($module, $uid = NULL, $name = NULL) {
}
return NULL;
}
$return = [];
// If $module and $uid were passed, return data keyed by name.
elseif (isset($uid)) {
$return = [];
if (isset($uid)) {
foreach ($result as $record) {
$return[$record->name] = ($record->serialized ? unserialize($record->value) : $record->value);
}
return $return;
}
// If $module and $name were passed, return data keyed by uid.
elseif (isset($name)) {
$return = [];
if (isset($name)) {
foreach ($result as $record) {
$return[$record->uid] = ($record->serialized ? unserialize($record->value) : $record->value);
}
return $return;
}
// If only $module was passed, return data keyed by uid and name.
else {
$return = [];
foreach ($result as $record) {
$return[$record->uid][$record->name] = ($record->serialized ? unserialize($record->value) : $record->value);
}
return $return;
foreach ($result as $record) {
$return[$record->uid][$record->name] = ($record->serialized ? unserialize($record->value) : $record->value);
}
return $return;
}
/**
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment