Added default to Utils::param()

This commit is contained in:
Andy Miller
2019-05-28 19:52:08 +02:00
parent e1eed973a2
commit e0d1385061
2 changed files with 4 additions and 3 deletions

View File

@@ -300,16 +300,17 @@ class Uri
* Get URI parameter.
*
* @param string $id
* @param bool $default
*
* @return bool|string
*/
public function param($id)
public function param($id, $default = false)
{
if (isset($this->params[$id])) {
return html_entity_decode(rawurldecode($this->params[$id]));
}
return false;
return $default;
}
/**

View File

@@ -1260,7 +1260,7 @@ abstract class Utils
*/
public static function sortArrayByArray(array $array, array $orderArray)
{
$ordered = array();
$ordered = [];
foreach ($orderArray as $key) {
if (array_key_exists($key, $array)) {
$ordered[$key] = $array[$key];