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

Breadcrumb

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

function FixerHelper::removeWhitespaceBefore

2 calls to FixerHelper::removeWhitespaceBefore()
RequireMultiLineCallSniff::process in vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Functions/RequireMultiLineCallSniff.php
* @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint *
RequireMultiLineConditionSniff::process in vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/RequireMultiLineConditionSniff.php
* @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint *

File

vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/FixerHelper.php, line 33

Class

FixerHelper
@internal

Namespace

SlevomatCodingStandard\Helpers

Code

public static function removeWhitespaceBefore(File $phpcsFile, int $pointer) : void {
    for ($i = $pointer - 1; $i > 0; $i--) {
        if (preg_match('~^\\s+$~', $phpcsFile->fixer
            ->getTokenContent($i)) === 0) {
            break;
        }
        $phpcsFile->fixer
            ->replaceToken($i, '');
    }
}
RSS feed
Powered by Drupal