phpstan 2.0 upgrade and fixes
This commit is contained in:
@@ -27,7 +27,9 @@
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "^9",
|
||||
"phpstan/phpstan": "^1.10",
|
||||
"phan/phan": "^5.4"
|
||||
"phan/phan": "^5.4",
|
||||
"phpstan/phpstan": "^2.0",
|
||||
"phpstan/phpdoc-parser": "^2.0",
|
||||
"phpstan/phpstan-deprecation-rules": "^2.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -60,7 +60,7 @@ class DotEnv
|
||||
$block = false;
|
||||
$var = '';
|
||||
$prefix_name = '';
|
||||
while ($line = fgets($fp)) {
|
||||
while (($line = fgets($fp)) !== false) {
|
||||
// [] block must be a single line, or it will be ignored
|
||||
if (preg_match("/^\s*\[([\w_.\s]+)\]/", $line, $matches)) {
|
||||
$prefix_name = preg_replace("/\s+/", "_", $matches[1]) . ".";
|
||||
@@ -104,6 +104,9 @@ class DotEnv
|
||||
// just be sure it is init before we fill
|
||||
if (!isset($_ENV[$var])) {
|
||||
$_ENV[$var] = '';
|
||||
} elseif (!is_string($_ENV[$var])) {
|
||||
// if this is not string, skip
|
||||
continue;
|
||||
}
|
||||
// strip line of slashes
|
||||
$_ENV[$var] .= stripslashes($line);
|
||||
|
||||
Reference in New Issue
Block a user