Skip to content

Commit

Permalink
Avoid file_exists deprecation warning
Browse files Browse the repository at this point in the history
file_exists(): Passing null to parameter #1 ($filename) of type string is deprecated
  • Loading branch information
timkelty committed Feb 23, 2024
1 parent 0adebc5 commit 4f15949
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/services/Webpack.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ private function _getEnvVars(string $class): ?array
$envFile = $this->_getEnvFilePath($class);

// TODO: Use DotEnv::parse() when we version is bumped.
$fileContents = file_exists($envFile) ? @file_get_contents($envFile) : null;
$fileContents = $envFile && file_exists($envFile) ? @file_get_contents($envFile) : null;

if (!$fileContents) {
return $this->_envFileVariables[$class] = [];
Expand Down

0 comments on commit 4f15949

Please sign in to comment.