mirror of
https://github.com/skipperbent/simple-php-router.git
synced 2026-06-17 00:37:52 +00:00
Features & bugfixes
- Feature: added new getFirstHeader to Request object that will return the first header found from array list- used to simplify the code. - Feature: added new InputHandler::getValueFromArray method that loops through input-items to ensure that value is always returned. - Fixed calling getUrl with array as parameters option throws error. - Fixed `SimpleRouter::getUrl` having wrong nullable return type.
This commit is contained in:
@@ -371,7 +371,7 @@ class Url implements \JsonSerializable
|
||||
*/
|
||||
public function getParam(string $name, ?string $defaultValue = null): ?string
|
||||
{
|
||||
return isset($this->getParams()[$name]) ?? $defaultValue;
|
||||
return (isset($this->getParams()[$name]) === true) ? $this->getParams()[$name] : $defaultValue;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user