Skip to content

Commit

Permalink
5.x widen types from env() (#16591)
Browse files Browse the repository at this point in the history
The `REQUEST_TIME` env var that debugkit relies on (and likely userland
code) is of type int. I'm adding float as well to mitigate future issues
being reported.
  • Loading branch information
markstory committed Jun 29, 2022
1 parent b1a72c3 commit dd97fbb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions functions.php
Expand Up @@ -189,10 +189,10 @@ function pj(mixed $var): mixed
*
* @param string $key Environment variable name.
* @param string|bool|null $default Specify a default value in case the environment variable is not defined.
* @return string|bool|null Environment variable setting.
* @return string|float|int|bool|null Environment variable setting.
* @link https://book.cakephp.org/4/en/core-libraries/global-constants-and-functions.html#env
*/
function env(string $key, string|bool|null $default = null): string|bool|null
function env(string $key, string|bool|null $default = null): string|float|int|bool|null
{
if ($key === 'HTTPS') {
if (isset($_SERVER['HTTPS'])) {
Expand Down

0 comments on commit dd97fbb

Please sign in to comment.