Skip to content
Snippets Groups Projects

Resolve #3238915 "Refactor if feasible"

4 files
+ 33
2
Compare changes
  • Side-by-side
  • Inline
Files
4
  • fc14cbc6
    Issue #3283498 by Mile23, alexpott: Scaffold ReplaceOp::copyScaffold() throws... · fc14cbc6
    Alex Pott authored
    Issue #3283498 by Mile23, alexpott: Scaffold ReplaceOp::copyScaffold() throws an error for empty files
@@ -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 <info>[src-rel-path]</info> to <info>[dest-rel-path]</info>!"));
}
$io->write($interpolator->interpolate(" - Copy <info>[dest-rel-path]</info> from <info>[src-rel-path]</info>"));
Loading