From d5ab072ec1ab41ebf830acf81cc04e8f221fe733 Mon Sep 17 00:00:00 2001 From: vlakoff Date: Tue, 17 Mar 2015 15:52:44 +0100 Subject: [PATCH] Optimize check for empty file --- src/Composer/Command/RequireCommand.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Composer/Command/RequireCommand.php b/src/Composer/Command/RequireCommand.php index 681fcbfda..82401ffb2 100644 --- a/src/Composer/Command/RequireCommand.php +++ b/src/Composer/Command/RequireCommand.php @@ -82,7 +82,7 @@ EOT return 1; } - if (file_get_contents($file) === '') { + if (filesize($file) === 0) { file_put_contents($file, "{\n}\n"); }