Skip to content

Commit cbd7fa3

Browse files
Avoid is_null
1 parent 937df8e commit cbd7fa3

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/Loader.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ protected function resolveNestedVariables($value)
252252
'/\${([a-zA-Z0-9_]+)}/',
253253
function ($matchedPatterns) use ($loader) {
254254
$nestedVariable = $loader->getEnvironmentVariable($matchedPatterns[1]);
255-
if (is_null($nestedVariable)) {
255+
if ($nestedVariable === null) {
256256
return $matchedPatterns[0];
257257
} else {
258258
return $nestedVariable;
@@ -333,7 +333,7 @@ public function setEnvironmentVariable($name, $value = null)
333333

334334
// Don't overwrite existing environment variables if we're immutable
335335
// Ruby's dotenv does this with `ENV[key] ||= value`.
336-
if ($this->immutable === true && !is_null($this->getEnvironmentVariable($name))) {
336+
if ($this->immutable === true && $this->getEnvironmentVariable($name) !== null) {
337337
return;
338338
}
339339

src/Validator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public function __construct(array $variables, Loader $loader)
4141

4242
$this->assertCallback(
4343
function ($value) {
44-
return !is_null($value);
44+
return $value !== null;
4545
},
4646
'is missing'
4747
);

0 commit comments

Comments
 (0)