Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 880a62b

Browse files
authored
Avoid reading the file if it does not exist
1 parent 64872c2 commit 880a62b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Symfony/Component/Runtime/Internal/ComposerPlugin.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ public function updateAutoloadFile(): void
107107

108108
// could use Composer\Util\Filesystem::filePutContentsIfModified once Composer 1.x support is dropped for this plugin
109109
$path = substr_replace($autoloadFile, '_runtime', -4, 0);
110-
$currentContent = @file_get_contents($path);
110+
$currentContent = @file_exists($path) ? @file_get_contents($path) : false;
111111
if (false === $currentContent || $currentContent !== $code) {
112112
file_put_contents($path, $code);
113113
}

0 commit comments

Comments
 (0)