class SkipOp

Same name in other branches
  1. 9 composer/Plugin/Scaffold/Operations/SkipOp.php \Drupal\Composer\Plugin\Scaffold\Operations\SkipOp
  2. 10 composer/Plugin/Scaffold/Operations/SkipOp.php \Drupal\Composer\Plugin\Scaffold\Operations\SkipOp
  3. 11.x composer/Plugin/Scaffold/Operations/SkipOp.php \Drupal\Composer\Plugin\Scaffold\Operations\SkipOp

Scaffold operation to skip a scaffold file (do nothing).

@internal

Hierarchy

Expanded class hierarchy of SkipOp

2 files declare their use of SkipOp
ScaffoldFileCollectionTest.php in core/tests/Drupal/Tests/Composer/Plugin/Scaffold/Integration/ScaffoldFileCollectionTest.php
SkipOpTest.php in core/tests/Drupal/Tests/Composer/Plugin/Scaffold/Integration/SkipOpTest.php

File

composer/Plugin/Scaffold/Operations/SkipOp.php, line 14

Namespace

Drupal\Composer\Plugin\Scaffold\Operations
View source
class SkipOp extends AbstractOperation {
    
    /**
     * Identifies Skip operations.
     */
    const ID = 'skip';
    
    /**
     * The message to output while processing.
     *
     * @var string
     */
    protected $message;
    
    /**
     * SkipOp constructor.
     *
     * @param string $message
     *   (optional) A custom message to output while skipping.
     */
    public function __construct($message = "  - Skip <info>[dest-rel-path]</info>: disabled") {
        $this->message = $message;
    }
    
    /**
     * {@inheritdoc}
     */
    protected function generateContents() {
        return '';
    }
    
    /**
     * {@inheritdoc}
     */
    public function process(ScaffoldFilePath $destination, IOInterface $io, ScaffoldOptions $options) {
        $interpolator = $destination->getInterpolator();
        $io->write($interpolator->interpolate($this->message));
        return new ScaffoldResult($destination, FALSE);
    }

}

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::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
SkipOp::$message protected property The message to output while processing.
SkipOp::generateContents protected function Load the scaffold contents or otherwise generate what is needed. Overrides AbstractOperation::generateContents
SkipOp::ID constant Identifies Skip operations.
SkipOp::process public function Process this scaffold operation. Overrides OperationInterface::process
SkipOp::__construct public function SkipOp constructor.

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.