Skip to content

Commit df1f779

Browse files
committed
Issue #3283498 by Mile23, alexpott: Scaffold ReplaceOp::copyScaffold() throws an error for empty files
(cherry picked from commit fc14cbc68591d94744228d2bf7fb13e212305b26)
1 parent 3286dbf commit df1f779

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

Operations/ReplaceOp.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,7 @@ public function process(ScaffoldFilePath $destination, IOInterface $io, Scaffold
9292
protected function copyScaffold(ScaffoldFilePath $destination, IOInterface $io) {
9393
$interpolator = $destination->getInterpolator();
9494
$this->source->addInterpolationData($interpolator);
95-
$success = file_put_contents($destination->fullPath(), $this->contents());
96-
if (!$success) {
95+
if (file_put_contents($destination->fullPath(), $this->contents()) === FALSE) {
9796
throw new \RuntimeException($interpolator->interpolate("Could not copy source file <info>[src-rel-path]</info> to <info>[dest-rel-path]</info>!"));
9897
}
9998
$io->write($interpolator->interpolate(" - Copy <info>[dest-rel-path]</info> from <info>[src-rel-path]</info>"));

0 commit comments

Comments
 (0)