mirror of
https://github.com/skipperbent/simple-php-router.git
synced 2026-06-17 08:47:52 +00:00
[OPTIMISATION] Optimized get method in Input class to trim value and return default value if empty.
This commit is contained in:
@@ -89,7 +89,7 @@ class Input {
|
|||||||
return ($key !== null && isset($item->getValue()[$key])) ? $item->getValue()[$key] : $item->getValue();
|
return ($key !== null && isset($item->getValue()[$key])) ? $item->getValue()[$key] : $item->getValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
return ($item->getValue() === null) ? $default : $item->getValue();
|
return (trim($item->getValue()) === '') ? $default : $item->getValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
return $default;
|
return $default;
|
||||||
|
|||||||
Reference in New Issue
Block a user