interface OperationInterface in Drupal 8
Same name and namespace in other branches
- 9 composer/Plugin/Scaffold/Operations/OperationInterface.php \Drupal\Composer\Plugin\Scaffold\Operations\OperationInterface
- 10 composer/Plugin/Scaffold/Operations/OperationInterface.php \Drupal\Composer\Plugin\Scaffold\Operations\OperationInterface
Interface for scaffold operation objects.
@internal
Hierarchy
- interface \Drupal\Composer\Plugin\Scaffold\Operations\OperationInterface
Expanded class hierarchy of OperationInterface
All classes that implement OperationInterface
1 file declares its use of OperationInterface
- ScaffoldFileInfo.php in composer/
Plugin/ Scaffold/ ScaffoldFileInfo.php
File
- composer/
Plugin/ Scaffold/ Operations/ OperationInterface.php, line 14
Namespace
Drupal\Composer\Plugin\Scaffold\OperationsView source
interface OperationInterface {
/**
* Returns the exact data that will be written to the scaffold files.
*
* @return string
* Data to be written to the scaffold location.
*/
public function contents();
/**
* Process this scaffold operation.
*
* @param \Drupal\Composer\Plugin\Scaffold\ScaffoldFilePath $destination
* Scaffold file's destination path.
* @param \Composer\IO\IOInterface $io
* IOInterface to write to.
* @param \Drupal\Composer\Plugin\Scaffold\ScaffoldOptions $options
* Various options that may alter the behavior of the operation.
*
* @return \Drupal\Composer\Plugin\Scaffold\Operations\ScaffoldResult
* Result of the scaffolding operation.
*/
public function process(ScaffoldFilePath $destination, IOInterface $io, ScaffoldOptions $options);
/**
* Determines what to do if operation is used at same path as a previous op.
*
* Default behavior is to scaffold this operation at the specified
* destination, ignoring whatever was there before.
*
* @param OperationInterface $existing_target
* Existing file at the destination path that we should combine with.
*
* @return OperationInterface
* The op to use at this destination.
*/
public function scaffoldOverExistingTarget(OperationInterface $existing_target);
/**
* Determines what to do if operation is used without a previous operation.
*
* Default behavior is to scaffold this operation at the specified
* destination. Most operations overwrite rather than modify existing files,
* and therefore do not need to do anything special when there is no existing
* file.
*
* @param \Drupal\Composer\Plugin\Scaffold\ScaffoldFilePath $destination
* Scaffold file's destination path.
*
* @return OperationInterface
* The op to use at this destination.
*/
public function scaffoldAtNewLocation(ScaffoldFilePath $destination);
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
OperationInterface:: |
public | function | Returns the exact data that will be written to the scaffold files. | 1 |
OperationInterface:: |
public | function | Process this scaffold operation. | 3 |
OperationInterface:: |
public | function | Determines what to do if operation is used without a previous operation. | 1 |
OperationInterface:: |
public | function | Determines what to do if operation is used at same path as a previous op. | 1 |