Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Ability to get default value if the parameter key does not exist on g…
…etParameter() function
  • Loading branch information
ptuchik authored Apr 5, 2019
commit 6e26dfd6bfc096fbdd9cbc6f6ecaf20091a7545e
7 changes: 5 additions & 2 deletions src/Common/ParametersTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,14 @@ protected function setParameter($key, $value)
/**
* Get one parameter.
*
* @param string $key The key
* @param mixed $default The default value if the parameter key does not exist
*
* @return mixed A single parameter value.
*/
protected function getParameter($key)
protected function getParameter($key, $default = null)
{
return $this->parameters->get($key);
return $this->parameters->get($key, $default);
}

/**
Expand Down