src/Standards/BestIt/Sniffs/Formatting/SpaceAfterDeclareSniff.php
private function handleMuchWhitespacesFound(
        File $phpcsFile,
        int $semicolonPtr,
        int $secondSpacePtr,
        int $nextNonSpacePtr
    ): void {
        $fixMuchWhitespaces = $phpcsFile->addFixableError(
            self::MESSAGE_MUCH_WHITESPACE_FOUND,
            $semicolonPtr,
            static::CODE_MUCH_WHITESPACE_FOUND
        );

        if ($fixMuchWhitespaces) {
            $phpcsFile->fixer->beginChangeset();
            for ($i = $secondSpacePtr; $i < $nextNonSpacePtr; $i++) {
                $phpcsFile->fixer->replaceToken($i, '');
            }
            $phpcsFile->fixer->endChangeset();
        }
    }
private function handleMuchWhitespacesFound(
        File $phpcsFile,
        int $semicolonPtr,
        int $secondSpacePtr,
        int $nextNonSpacePtr
    ): void {
        $fixMuchWhitespaces = $phpcsFile->addFixableError(
            self::MESSAGE_MUCH_WHITESPACE_FOUND,
            $semicolonPtr,
            static::CODE_MUCH_WHITESPACE_FOUND
        );

        if ($fixMuchWhitespaces) {
            $phpcsFile->fixer->beginChangeset();
            for ($i = $secondSpacePtr; $i < $nextNonSpacePtr; $i++) {
                $phpcsFile->fixer->replaceToken($i, '');
            }
            $phpcsFile->fixer->endChangeset();
        }
    }
private function handleMuchWhitespacesFound ( File $ phpcsFile , int $ semicolonPtr , int $ secondSpacePtr , int $ nextNonSpacePtr ) : void { $ fixMuchWhitespaces = $ phpcsFile -> addFixableError ( self :: MESSAGE_MUCH_WHITESPACE_FOUND , $ semicolonPtr , static :: CODE_MUCH_WHITESPACE_FOUND ) ; if ( $ fixMuchWhitespaces ) { $ phpcsFile -> fixer -> beginChangeset ( ) ; for ( $ i = $ secondSpacePtr ; $ i < $ nextNonSpacePtr ; $ i ++ ) { $ phpcsFile -> fixer -> replaceToken ( $ i , '' ) ; } $ phpcsFile -> fixer -> endChangeset ( ) ; } }
Handles when more than one whitespaces are found.

@param File $phpcsFile The php cs file
@param int $semicolonPtr Pointer to the semicolon
@param int $secondSpacePtr Pointer to the second space
@param int $nextNonSpacePtr Pointer to the next non space token

@return void
Handles when more than one whitespaces are found .