mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 23:45:10 +00:00
Code cleanup.
This commit is contained in:
@@ -17,19 +17,14 @@ class Preferences implements PreferencesInterface
|
||||
public function get($name, $default = null)
|
||||
{
|
||||
$pref = \Preference::where('user_id', \Auth::user()->id)->where('name', $name)->first();
|
||||
if (is_null($default) && is_null($pref)) {
|
||||
if (is_null($pref) && is_null($default)) {
|
||||
// return NULL
|
||||
return null;
|
||||
}
|
||||
if (!is_null($pref)) {
|
||||
return $pref;
|
||||
}
|
||||
if (!is_null($default) && is_null($pref)) {
|
||||
// create preference, return that:
|
||||
return $this->set($name, $default);
|
||||
}
|
||||
|
||||
return null;
|
||||
return $this->set($name, $default);
|
||||
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user