You are here

class PreCommitEvent in Automatic Updates 8.2

Event fired before staged changes are copied into the active site.

Hierarchy

Expanded class hierarchy of PreCommitEvent

3 files declare their use of PreCommitEvent
StagedProjectsValidator.php in src/Validator/StagedProjectsValidator.php
StagedProjectsValidatorTest.php in tests/src/Unit/StagedProjectsValidatorTest.php
Updater.php in src/Updater.php

File

src/Event/PreCommitEvent.php, line 10

Namespace

Drupal\automatic_updates\Event
View source
class PreCommitEvent extends UpdateEvent {
  use ExcludedPathsTrait;

  /**
   * The Composer utility object for the stage directory.
   *
   * @var \Drupal\package_manager\ComposerUtility
   */
  protected $stageComposer;

  /**
   * Constructs a new PreCommitEvent object.
   *
   * @param \Drupal\package_manager\ComposerUtility $active_composer
   *   A Composer utility object for the active directory.
   * @param \Drupal\package_manager\ComposerUtility $stage_composer
   *   A Composer utility object for the stage directory.
   */
  public function __construct(ComposerUtility $active_composer, ComposerUtility $stage_composer) {
    parent::__construct($active_composer);
    $this->stageComposer = $stage_composer;
  }

  /**
   * Returns a Composer utility object for the stage directory.
   *
   * @return \Drupal\package_manager\ComposerUtility
   *   The Composer utility object for the stage directory.
   */
  public function getStageComposer() : ComposerUtility {
    return $this->stageComposer;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
ExcludedPathsTrait::$excludedPaths protected property Paths to exclude from the update.
ExcludedPathsTrait::excludePath public function Adds an absolute path to exclude from the update operation.
ExcludedPathsTrait::getExcludedPaths public function Returns the paths to exclude from the update operation.
PreCommitEvent::$stageComposer protected property The Composer utility object for the stage directory.
PreCommitEvent::getStageComposer public function Returns a Composer utility object for the stage directory.
PreCommitEvent::__construct public function Constructs a new PreCommitEvent object. Overrides UpdateEvent::__construct
UpdateEvent::$activeComposer protected property The Composer utility object for the active directory.
UpdateEvent::$results protected property The validation results.
UpdateEvent::addValidationResult public function Adds a validation result.
UpdateEvent::getActiveComposer public function Returns a Composer utility object for the active directory.
UpdateEvent::getResults public function Gets the validation results.