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

Breadcrumb

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

function Fixer::endChangeset

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

Return value

boolean

1 call to Fixer::endChangeset()
Fixer::changeCodeBlockIndent in vendor/squizlabs/php_codesniffer/src/Fixer.php
Adjust the indent of a code block.

File

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

Class

Fixer

Namespace

PHP_CodeSniffer

Code

public function endChangeset() {
    if ($this->inConflict === true) {
        return false;
    }
    $this->inChangeset = false;
    $success = true;
    $applied = [];
    foreach ($this->changeset as $stackPtr => $content) {
        $success = $this->replaceToken($stackPtr, $content);
        if ($success === false) {
            break;
        }
        else {
            $applied[] = $stackPtr;
        }
    }
    if ($success === false) {
        // Rolling back all changes.
        foreach ($applied as $stackPtr) {
            $this->revertToken($stackPtr);
        }
        if (PHP_CODESNIFFER_VERBOSITY > 1) {
            @ob_end_clean();
            echo "\t=> Changeset failed to apply" . PHP_EOL;
            ob_start();
        }
    }
    else {
        if (PHP_CODESNIFFER_VERBOSITY > 1) {
            $fixes = count($this->changeset);
            @ob_end_clean();
            echo "\t=> Changeset ended: {$fixes} changes applied" . PHP_EOL;
            ob_start();
        }
    }
    $this->changeset = [];
    return true;
}

API Navigation

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