function RequireMultiLineTernaryOperatorSniff::getIndentation
1 call to RequireMultiLineTernaryOperatorSniff::getIndentation()
- RequireMultiLineTernaryOperatorSniff::process in vendor/
slevomat/ coding-standard/ SlevomatCodingStandard/ Sniffs/ ControlStructures/ RequireMultiLineTernaryOperatorSniff.php - * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint *
File
-
vendor/
slevomat/ coding-standard/ SlevomatCodingStandard/ Sniffs/ ControlStructures/ RequireMultiLineTernaryOperatorSniff.php, line 162
Class
Namespace
SlevomatCodingStandard\Sniffs\ControlStructuresCode
private function getIndentation(File $phpcsFile, int $endOfLinePointer) : string {
$pointerAfterWhitespace = TokenHelper::findNextNonWhitespace($phpcsFile, $endOfLinePointer + 1);
$actualIndentation = TokenHelper::getContent($phpcsFile, $endOfLinePointer + 1, $pointerAfterWhitespace - 1);
if (strlen($actualIndentation) !== 0) {
return $actualIndentation . (substr($actualIndentation, -1) === IndentationHelper::TAB_INDENT ? IndentationHelper::TAB_INDENT : IndentationHelper::SPACES_INDENT);
}
$tabPointer = TokenHelper::findPreviousContent($phpcsFile, T_WHITESPACE, IndentationHelper::TAB_INDENT, $endOfLinePointer - 1);
return $tabPointer !== null ? IndentationHelper::TAB_INDENT : IndentationHelper::SPACES_INDENT;
}