From df1f779d3f94500f6cc791427aa729e0ba4b2464 Mon Sep 17 00:00:00 2001 From: Alex Pott Date: Sun, 19 Jun 2022 17:14:06 +0100 Subject: [PATCH] Issue #3283498 by Mile23, alexpott: Scaffold ReplaceOp::copyScaffold() throws an error for empty files (cherry picked from commit fc14cbc68591d94744228d2bf7fb13e212305b26) --- Operations/ReplaceOp.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Operations/ReplaceOp.php b/Operations/ReplaceOp.php index 66f8ea35b34..71d610c9f43 100644 --- a/Operations/ReplaceOp.php +++ b/Operations/ReplaceOp.php @@ -92,8 +92,7 @@ public function process(ScaffoldFilePath $destination, IOInterface $io, Scaffold protected function copyScaffold(ScaffoldFilePath $destination, IOInterface $io) { $interpolator = $destination->getInterpolator(); $this->source->addInterpolationData($interpolator); - $success = file_put_contents($destination->fullPath(), $this->contents()); - if (!$success) { + if (file_put_contents($destination->fullPath(), $this->contents()) === FALSE) { throw new \RuntimeException($interpolator->interpolate("Could not copy source file [src-rel-path] to [dest-rel-path]!")); } $io->write($interpolator->interpolate(" - Copy [dest-rel-path] from [src-rel-path]"));