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

Breadcrumb

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

function Fixer::rollbackChangeset

Stop recording actions for a changeset, and discard logged changes.

Return value

void

File

vendor/squizlabs/php_codesniffer/src/Fixer.php, line 474

Class

Fixer

Namespace

PHP_CodeSniffer

Code

public function rollbackChangeset() {
    $this->inChangeset = false;
    $this->inConflict = false;
    if (empty($this->changeset) === false) {
        if (PHP_CODESNIFFER_VERBOSITY > 1) {
            $bt = debug_backtrace();
            if ($bt[1]['class'] === 'PHP_CodeSniffer\\Fixer') {
                $sniff = $bt[2]['class'];
                $line = $bt[1]['line'];
            }
            else {
                $sniff = $bt[1]['class'];
                $line = $bt[0]['line'];
            }
            $sniff = Common::getSniffCode($sniff);
            $numChanges = count($this->changeset);
            @ob_end_clean();
            echo "\t\tR: {$sniff}:{$line} rolled back the changeset ({$numChanges} changes)" . PHP_EOL;
            echo "\t=> Changeset rolled back" . PHP_EOL;
            ob_start();
        }
        $this->changeset = [];
    }
    
    //end if
}
RSS feed
Powered by Drupal