You are here

public function AppendOp::scaffoldOverExistingTarget in Drupal 9

Same name and namespace in other branches
  1. 8 composer/Plugin/Scaffold/Operations/AppendOp.php \Drupal\Composer\Plugin\Scaffold\Operations\AppendOp::scaffoldOverExistingTarget()

Determines what to do if operation is used at same path as a previous op.

Default behavior is to scaffold this operation at the specified destination, ignoring whatever was there before.

Parameters

OperationInterface $existing_target: Existing file at the destination path that we should combine with.

Return value

OperationInterface The op to use at this destination.

Overrides AbstractOperation::scaffoldOverExistingTarget

File

composer/Plugin/Scaffold/Operations/AppendOp.php, line 145

Class

AppendOp
Scaffold operation to add to the beginning and/or end of a scaffold file.

Namespace

Drupal\Composer\Plugin\Scaffold\Operations

Code

public function scaffoldOverExistingTarget(OperationInterface $existing_target) {
  $this->originalContents = $existing_target
    ->contents();
  return $this;
}