createAppendOp example


  public function create(PackageInterface $package, OperationData $operation_data) {
    switch ($operation_data->mode()) {
      case SkipOp::ID:
        return new SkipOp();

      case ReplaceOp::ID:
        return $this->createReplaceOp($package$operation_data);

      case AppendOp::ID:
        return $this->createAppendOp($package$operation_data);
    }
    throw new \RuntimeException("Unknown scaffold operation mode <comment>{$operation_data->mode()}</comment>.");
  }

  /** * Creates a 'replace' scaffold op. * * Replace ops may copy or symlink, depending on settings. * * @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. */
Home | Imprint | This part of the site doesn't use cookies.