mirror of
https://github.com/skipperbent/simple-php-router.git
synced 2026-07-11 22:32:14 +00:00
Fixed defaultValue issue in getValue method in InputHandler class.
This commit is contained in:
@@ -244,12 +244,7 @@ class InputHandler
|
|||||||
public function getValue(string $index, ?string $defaultValue = null, ...$methods): ?string
|
public function getValue(string $index, ?string $defaultValue = null, ...$methods): ?string
|
||||||
{
|
{
|
||||||
$input = $this->get($index, $methods);
|
$input = $this->get($index, $methods);
|
||||||
|
return ($input === null || ($input !== null && trim($input->getValue()) === '')) ? $defaultValue : $input->getValue();
|
||||||
if ($input !== null) {
|
|
||||||
return (trim($input->getValue()) === '') ? $defaultValue : $input->getValue();
|
|
||||||
}
|
|
||||||
|
|
||||||
return $input;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user