Skip to content

Commit

Permalink
Merge pull request #3 from unamatasanatarai/patch-1
Browse files Browse the repository at this point in the history
Remove unnecessary comments and simplify syntax
  • Loading branch information
Taronyuu authored Jul 11, 2018
2 parents 3ef1218 + 2efe85f commit 3d65faf
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/Traits/HasSettingsTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,10 @@ public function setting($key, $value = null)
{
$this->validateKey($key);

// If the value is not null, it means we are trying to set it. So update the value.
// Otherwise return the setting.
if($value === null) {
return $this->getSetting($key);
} else {
return $this->setSetting($key, $value);
}
return $this->setSetting($key, $value);
}

/**
Expand Down Expand Up @@ -170,4 +167,4 @@ protected function validateKey($key)
throw new InvalidUserSettingsFieldUsed("Invalid settings field key given, this object is not allowed to use this key.");
}
}
}
}

0 comments on commit 3d65faf

Please sign in to comment.