diff --git a/src/Standards/Squiz/Sniffs/Functions/FunctionDeclarationArgumentSpacingSniff.php b/src/Standards/Squiz/Sniffs/Functions/FunctionDeclarationArgumentSpacingSniff.php index 5b382e1fc2..0813a45e87 100644 --- a/src/Standards/Squiz/Sniffs/Functions/FunctionDeclarationArgumentSpacingSniff.php +++ b/src/Standards/Squiz/Sniffs/Functions/FunctionDeclarationArgumentSpacingSniff.php @@ -245,9 +245,15 @@ public function processBracket($phpcsFile, $openBracket) $error = 'Expected 1 space between type hint and argument "%s"; %s found'; $data = [ $param['name'], - $gap, ]; - $fix = $phpcsFile->addFixableError($error, $typeHintToken, 'SpacingAfterHint', $data); + $found = str_replace(["\r", "\n", "\t"], ['\r', '\n', '\t'], $gap); + if ($found === $gap) { + $data[] = strlen($gap); + } else { + $data[] = '"'.$found.'"'; + } + + $fix = $phpcsFile->addFixableError($error, $typeHintToken, 'SpacingAfterHint', $data); if ($fix === true) { $phpcsFile->fixer->beginChangeset(); $i = $typeHintToken;