Skip to content
This repository has been archived by the owner on Sep 19, 2023. It is now read-only.

Commit

Permalink
Add defaultValue to DbSettings ->get()
Browse files Browse the repository at this point in the history
  • Loading branch information
Aleksey-Fedorenko committed Apr 3, 2019
1 parent db2a779 commit 2f621e5
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/components/DbSettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,4 +104,14 @@ protected function setValue($section, $key, $value)
}
return $this->insertValue($section, $key, $value);
}

/**
* {@inheritDoc}
*
* @param mixed $defaultValue Default value if $key not exists
*/
public function get($section, $key, $defaultValue = null)
{
return parent::get($section, $key) ?? $defaultValue;
}
}

0 comments on commit 2f621e5

Please sign in to comment.