class AbstractOperation
Provides default behaviors for operations.
@internal
Hierarchy
- class \Drupal\Composer\Plugin\Scaffold\Operations\AbstractOperation implements \Drupal\Composer\Plugin\Scaffold\Operations\OperationInterface
Expanded class hierarchy of AbstractOperation
File
- 
              composer/Plugin/ Scaffold/ Operations/ AbstractOperation.php, line 12 
Namespace
Drupal\Composer\Plugin\Scaffold\OperationsView source
abstract class AbstractOperation implements OperationInterface {
  
  /**
   * Cached contents of scaffold file to be written to disk.
   *
   * @var string
   */
  protected $contents;
  
  /**
   * {@inheritdoc}
   */
  final public function contents() {
    if (!isset($this->contents)) {
      $this->contents = $this->generateContents();
    }
    return $this->contents;
  }
  
  /**
   * Load the scaffold contents or otherwise generate what is needed.
   *
   * @return string
   *   The contents of the scaffold file.
   */
  abstract protected function generateContents();
  
  /**
   * {@inheritdoc}
   */
  public function scaffoldOverExistingTarget(OperationInterface $existing_target) {
    return $this;
  }
  
  /**
   * {@inheritdoc}
   */
  public function scaffoldAtNewLocation(ScaffoldFilePath $destination) {
    return $this;
  }
}Members
| Title Sort descending | Modifiers | Object type | Summary | Overriden Title | Overrides | 
|---|---|---|---|---|---|
| AbstractOperation::$contents | protected | property | Cached contents of scaffold file to be written to disk. | ||
| AbstractOperation::contents | final public | function | Returns the exact data that will be written to the scaffold files. | Overrides OperationInterface::contents | |
| AbstractOperation::generateContents | abstract protected | function | Load the scaffold contents or otherwise generate what is needed. | 3 | |
| AbstractOperation::scaffoldAtNewLocation | public | function | Determines what to do if operation is used without a previous operation. | Overrides OperationInterface::scaffoldAtNewLocation | 1 | 
| AbstractOperation::scaffoldOverExistingTarget | public | function | Determines what to do if operation is used at same path as a previous op. | Overrides OperationInterface::scaffoldOverExistingTarget | 1 | 
| OperationInterface::process | public | function | Process this scaffold operation. | 3 | 
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.
