From 2efe85f15848f7cccb6a380a73d112c89695e73e Mon Sep 17 00:00:00 2001 From: Unamata Sanatarai Date: Wed, 11 Jul 2018 11:14:43 +0200 Subject: [PATCH] Remove unnecessary comments and simplify syntax The code is self explanatory. Comment is redundant. Simplified a `if` --- src/Traits/HasSettingsTrait.php | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/Traits/HasSettingsTrait.php b/src/Traits/HasSettingsTrait.php index 91f7247..01e5680 100644 --- a/src/Traits/HasSettingsTrait.php +++ b/src/Traits/HasSettingsTrait.php @@ -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); } /** @@ -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."); } } -} \ No newline at end of file +}