Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. VcsDownloader.php

function VcsDownloader::cleanChanges

Prompt the user to check if changes should be stashed/removed or the operation aborted

@phpstan-return PromiseInterface<void|null>

Parameters

bool $update if true (update) the changes can be stashed and reapplied after an update,: if false (remove) the changes should be assumed to be lost if the operation is not aborted

Throws

\RuntimeException in case the operation must be aborted

5 calls to VcsDownloader::cleanChanges()
GitDownloader::cleanChanges in vendor/composer/composer/src/Composer/Downloader/GitDownloader.php
@inheritDoc
GitDownloader::cleanChanges in vendor/composer/composer/src/Composer/Downloader/GitDownloader.php
@inheritDoc
SvnDownloader::cleanChanges in vendor/composer/composer/src/Composer/Downloader/SvnDownloader.php
@inheritDoc
SvnDownloader::cleanChanges in vendor/composer/composer/src/Composer/Downloader/SvnDownloader.php
@inheritDoc
VcsDownloader::prepare in vendor/composer/composer/src/Composer/Downloader/VcsDownloader.php
@inheritDoc
2 methods override VcsDownloader::cleanChanges()
GitDownloader::cleanChanges in vendor/composer/composer/src/Composer/Downloader/GitDownloader.php
@inheritDoc
SvnDownloader::cleanChanges in vendor/composer/composer/src/Composer/Downloader/SvnDownloader.php
@inheritDoc

File

vendor/composer/composer/src/Composer/Downloader/VcsDownloader.php, line 264

Class

VcsDownloader
@author Jordi Boggiano <j.boggiano@seld.be>

Namespace

Composer\Downloader

Code

protected function cleanChanges(PackageInterface $package, string $path, bool $update) : PromiseInterface {
    // the default implementation just fails if there are any changes, override in child classes to provide stash-ability
    if (null !== $this->getLocalChanges($package, $path)) {
        throw new \RuntimeException('Source directory ' . $path . ' has uncommitted changes.');
    }
    return \React\Promise\resolve(null);
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal