Skip to content

Commit

Permalink
upd functions
Browse files Browse the repository at this point in the history
  • Loading branch information
phphleb committed Dec 11, 2024
1 parent 615377e commit 99cc546
Showing 1 changed file with 50 additions and 0 deletions.
50 changes: 50 additions & 0 deletions Init/Review/basic.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,16 @@ function get_env(string $name, #[SensitiveParameter] mixed $default): string|int
}
}

if (!function_exists('hl_get_env')) {
/**
* @see get_env()
*/
function hl_get_env(string $name, #[SensitiveParameter] mixed $default): string|int|float|bool|null
{
return get_env($name, $default);
}
}

if (!function_exists('env')) {
/**
* Returns the original value of the environment variable, or $default if it is not found.
Expand All @@ -74,6 +84,16 @@ function env(string $name, #[SensitiveParameter] string $default): string
}
}

if (!function_exists('hl_env')) {
/**
* @see env()
*/
function hl_env(string $name, #[SensitiveParameter] string $default): string
{
return env($name, $default);
}
}

if (!function_exists('env_bool')) {
/**
* Converts to boolean and returns the environment variable
Expand Down Expand Up @@ -113,6 +133,16 @@ function env_bool(string $name, #[SensitiveParameter] bool $default): bool
}
}

if (!function_exists('hl_env_bool')) {
/**
* @see env_bool()
*/
function hl_env_bool(string $name, #[SensitiveParameter] bool $default): bool
{
return env_bool($name, $default);
}
}

if (!function_exists('env_int')) {
/**
* Converts to integer and returns the environment variable
Expand Down Expand Up @@ -145,6 +175,16 @@ function env_int(string $name, #[SensitiveParameter] int $default): int
}
}

if (!function_exists('hl_env_int')) {
/**
* @see env_int()
*/
function hl_env_int(string $name, #[SensitiveParameter] int $default): int
{
return env_int($name, $default);
}
}

if (!function_exists('env_array')) {
/**
* Converts to an array from a JSON string and returns the environment
Expand Down Expand Up @@ -173,6 +213,16 @@ function env_array(string $name, #[SensitiveParameter] array $default): array
}
}

if (!function_exists('hl_env_array')) {
/**
* @see env_array()
*/
function hl_env_array(string $name, #[SensitiveParameter] array $default): array
{
return env_array($name, $default);
}
}

if (!function_exists('_e')) {
/**
* Converter of characters to corresponding HTML entities.
Expand Down

0 comments on commit 99cc546

Please sign in to comment.