Skip to content

Commit

Permalink
Add a default return value
Browse files Browse the repository at this point in the history
  • Loading branch information
Nenglish7 authored Dec 21, 2017
1 parent 7d2ad83 commit 27563d2
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions main.bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,13 @@
/**
* Create an easy access function for configuration variables.
*/
function env($section, $variable = null)
function env($section, $variable = null, $defRetVal = '')
{
return Env::getConfig($section, $variable);
try {
return Env::getConfig($section, $variable);
} catch (\Genial\Env\Exception\UnderflowException) {
return $defRetVal;
}
}

/**
Expand Down

0 comments on commit 27563d2

Please sign in to comment.