Skip to content

Commit

Permalink
Make it possible to specify a fallbac
Browse files Browse the repository at this point in the history
k value when using Setting::get()
  • Loading branch information
heinzmuller committed Oct 11, 2013
1 parent 51e6e2c commit c6d0af8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Philf/Setting/Setting.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public function filename($filename)
* @param string $searchKey String using dot notation
* @return Mixed The value(s) found
*/
public function get($searchKey = null)
public function get($searchKey = null, $fallback = null)
{
if (empty($searchKey))
{
Expand All @@ -128,7 +128,7 @@ public function get($searchKey = null)
return $this->fallback->fallbackGet($searchKey);
}

return null;
return ($fallback ?: null);
}

/**
Expand Down

0 comments on commit c6d0af8

Please sign in to comment.