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

Breadcrumb

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

function Fixer::startFile

Starts fixing a new file.

Parameters

\PHP_CodeSniffer\Files\File $phpcsFile The file being fixed.:

Return value

void

File

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

Class

Fixer

Namespace

PHP_CodeSniffer

Code

public function startFile(File $phpcsFile) {
    $this->currentFile = $phpcsFile;
    $this->numFixes = 0;
    $this->fixedTokens = [];
    $tokens = $phpcsFile->getTokens();
    $this->tokens = [];
    foreach ($tokens as $index => $token) {
        if (isset($token['orig_content']) === true) {
            $this->tokens[$index] = $token['orig_content'];
        }
        else {
            $this->tokens[$index] = $token['content'];
        }
    }
}
RSS feed
Powered by Drupal