abstract class AbstractOperation in Drupal 9
Same name and namespace in other branches
- 8 composer/Plugin/Scaffold/Operations/AbstractOperation.php \Drupal\Composer\Plugin\Scaffold\Operations\AbstractOperation
Provides default behaviors for operations.
@internal
Hierarchy
- class \Drupal\Composer\Plugin\Scaffold\Operations\AbstractOperation implements 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}
*/
public final 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.
*/
protected abstract function generateContents();
/**
* {@inheritdoc}
*/
public function scaffoldOverExistingTarget(OperationInterface $existing_target) {
return $this;
}
/**
* {@inheritdoc}
*/
public function scaffoldAtNewLocation(ScaffoldFilePath $destination) {
return $this;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
AbstractOperation:: |
protected | property | Cached contents of scaffold file to be written to disk. | |
AbstractOperation:: |
final public | function |
Returns the exact data that will be written to the scaffold files. Overrides OperationInterface:: |
|
AbstractOperation:: |
abstract protected | function | Load the scaffold contents or otherwise generate what is needed. | 3 |
AbstractOperation:: |
public | function |
Determines what to do if operation is used without a previous operation. Overrides OperationInterface:: |
1 |
AbstractOperation:: |
public | function |
Determines what to do if operation is used at same path as a previous op. Overrides OperationInterface:: |
1 |
OperationInterface:: |
public | function | Process this scaffold operation. | 3 |