protected function createReplaceOp(PackageInterface
$package, OperationData
$operation_data) { if (!
$operation_data->
hasPath()) { throw new \
RuntimeException("'path' component required for 'replace' operations."
);
} $package_name =
$package->
getName();
$package_path =
$this->
getPackagePath($package);
$source = ScaffoldFilePath::
sourcePath($package_name,
$package_path,
$operation_data->
destination(),
$operation_data->
path());
$op =
new ReplaceOp($source,
$operation_data->
overwrite());
return $op;
} /**
* Creates an 'append' (or 'prepend') scaffold op.
*
* @param \Composer\Package\PackageInterface $package
* The package that relative paths will be relative from.
* @param OperationData $operation_data
* The parameter data for this operation object, i.e. the relative 'path'.
*
* @return \Drupal\Composer\Plugin\Scaffold\Operations\OperationInterface
* A scaffold replace operation object.
*/