diff --git a/src/Builder.php b/src/Builder.php index fcabaf5..4206cd5 100644 --- a/src/Builder.php +++ b/src/Builder.php @@ -181,14 +181,15 @@ public static function writeFile($path, array $data) /** * Writes file if content changed. - * @param string $path - * @param string $content + * @param string $path + * @param string $content */ - public static function putFile($path, $content) + protected static function putFile($path, $content) { - if ($content !== file_get_contents($path)) { - file_put_contents($path, $content); + if (file_exists($path) && $content = file_get_contents($path)) { + return; } + file_put_contents($path, $content); } /**