class AbstractOperation
Same name and namespace in other branches
- 10 composer/Plugin/Scaffold/Operations/AbstractOperation.php \Drupal\Composer\Plugin\Scaffold\Operations\AbstractOperation
- 11.x composer/Plugin/Scaffold/Operations/AbstractOperation.php \Drupal\Composer\Plugin\Scaffold\Operations\AbstractOperation
- 8.9.x 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 \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;
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.