Skip to content

Commit ec61715

Browse files
Use is_file() instead of file_exists() where possible
1 parent 75b0bbb commit ec61715

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

EnvVarProcessor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ public function getEnv(string $prefix, string $name, \Closure $getEnv)
114114
if (!is_scalar($file = $getEnv($name))) {
115115
throw new RuntimeException(sprintf('Invalid file name: env var "%s" is non-scalar.', $name));
116116
}
117-
if (!file_exists($file)) {
117+
if (!is_file($file)) {
118118
throw new EnvNotFoundException(sprintf('File "%s" not found (resolved from "%s").', $file, $name));
119119
}
120120

Loader/YamlFileLoader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -670,7 +670,7 @@ protected function loadFile($file)
670670
throw new InvalidArgumentException(sprintf('This is not a local file "%s".', $file));
671671
}
672672

673-
if (!file_exists($file)) {
673+
if (!is_file($file)) {
674674
throw new InvalidArgumentException(sprintf('The file "%s" does not exist.', $file));
675675
}
676676

0 commit comments

Comments
 (0)