function IndentationHelper::convertTabsToSpaces
4 calls to IndentationHelper::convertTabsToSpaces()
- AbstractLineCall::getLineStart in vendor/
slevomat/ coding-standard/ SlevomatCodingStandard/ Sniffs/ Functions/ AbstractLineCall.php - AbstractLineCondition::getLineStart in vendor/
slevomat/ coding-standard/ SlevomatCodingStandard/ Sniffs/ ControlStructures/ AbstractLineCondition.php - AbstractMethodSignature::getSignatureWithoutTabs in vendor/
slevomat/ coding-standard/ SlevomatCodingStandard/ Sniffs/ Classes/ AbstractMethodSignature.php - RequireMultiLineCallSniff::process in vendor/
slevomat/ coding-standard/ SlevomatCodingStandard/ Sniffs/ Functions/ RequireMultiLineCallSniff.php - * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint *
File
-
vendor/
slevomat/ coding-standard/ SlevomatCodingStandard/ Helpers/ IndentationHelper.php, line 95
Class
- IndentationHelper
- @internal
Namespace
SlevomatCodingStandard\HelpersCode
public static function convertTabsToSpaces(File $phpcsFile, string $code) : string {
return preg_replace_callback('~^(\\t+)~', static function (array $matches) use ($phpcsFile) : string {
$indentation = str_repeat(' ', $phpcsFile->config->tabWidth !== 0 ? $phpcsFile->config->tabWidth : self::DEFAULT_INDENTATION_WIDTH);
return str_repeat($indentation, strlen($matches[1]));
}, $code);
}