// Attach it all together.
return $prepend_contents .
$original_contents .
$append_contents;
} /**
* {@inheritdoc}
*/
public function process(ScaffoldFilePath
$destination, IOInterface
$io, ScaffoldOptions
$options) { $destination_path =
$destination->
fullPath();
$interpolator =
$destination->
getInterpolator();
// Be extra-noisy of creating a new file or appending to a non-scaffold
// file. Note that if the file already has the append contents, then the
// OperationFactory will make a SkipOp instead, and we will not get here.
if (!
$this->managed
) { $message = ' - <info>NOTICE</info> Modifying existing file at <info>[dest-rel-path]</info>.';
if (!
file_exists($destination_path)) { $message = ' - <info>NOTICE</info> Creating a new file at <info>[dest-rel-path]</info>.';
} $message .= ' Examine the contents and ensure that it came out correctly.';
$io->
write($interpolator->
interpolate($message));
}