fix: compatibilidad PHP 7.4 — str_starts_with, str_contains, match, never, mixed
This commit is contained in:
+3
-3
@@ -15,10 +15,10 @@ declare(strict_types=1);
|
||||
foreach ($lines as $line) {
|
||||
$line = trim($line);
|
||||
// Ignorar comentarios
|
||||
if ($line === '' || str_starts_with($line, '#')) {
|
||||
if ($line === '' || strpos($line, '#') === 0) {
|
||||
continue;
|
||||
}
|
||||
if (!str_contains($line, '=')) {
|
||||
if (strpos($line, '=') === false) {
|
||||
continue;
|
||||
}
|
||||
[$key, $value] = explode('=', $line, 2);
|
||||
@@ -32,7 +32,7 @@ declare(strict_types=1);
|
||||
}
|
||||
})();
|
||||
|
||||
function env(string $key, mixed $default = null): mixed
|
||||
function env(string $key, $default = null)
|
||||
{
|
||||
return $_ENV[$key] ?? getenv($key) ?: $default;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user