Loading coder_sniffer/Drupal/Sniffs/Commenting/DocCommentSniff.php +1 −0 Original line number Diff line number Diff line Loading @@ -435,6 +435,7 @@ class DocCommentSniff implements Sniff foreach ($tagGroups as $group) { $maxLength = 0; $paddings = []; $pos = 0; foreach ($group as $pos => $tag) { $tagLength = strlen($tokens[$tag]['content']); if ($tagLength > $maxLength) { Loading coder_sniffer/Drupal/Sniffs/Commenting/FunctionCommentSniff.php +3 −0 Original line number Diff line number Diff line Loading @@ -195,6 +195,7 @@ class FunctionCommentSniff implements Sniff $methodName = strtolower(ltrim($methodName, '_')); $return = null; $end = $stackPtr; foreach ($tokens[$commentStart]['comment_tags'] as $pos => $tag) { if ($tokens[$tag]['content'] === '@return') { if ($return !== null) { Loading Loading @@ -718,6 +719,8 @@ class FunctionCommentSniff implements Sniff } } $suggestedName = ''; $typeName = ''; if (count($typeNames) === 1) { $typeName = $param['type']; $suggestedName = static::suggestType($typeName); Loading coder_sniffer/Drupal/Sniffs/Commenting/InlineCommentSniff.php +2 −1 Original line number Diff line number Diff line Loading @@ -217,6 +217,7 @@ class InlineCommentSniff implements Sniff }//end while $commentText = ''; $lastCommentToken = $stackPtr; foreach ($commentTokens as $lastCommentToken) { $comment = rtrim($tokens[$lastCommentToken]['content']); Loading coder_sniffer/Drupal/Sniffs/Semantics/FunctionTriggerErrorSniff.php +5 −1 Original line number Diff line number Diff line Loading @@ -79,6 +79,7 @@ class FunctionTriggerErrorSniff extends FunctionCall // quotes away and possibly not report a faulty message. $messageText = substr($tokens[$messagePosition]['content'], 1, ($tokens[$messagePosition]['length'] - 2)); } else { $messageParts = []; // If not sprintf() then extract and store all the items except // whitespace, concatenation operators and comma. This will give all // real content such as concatenated strings and constants. Loading Loading @@ -112,7 +113,10 @@ class FunctionTriggerErrorSniff extends FunctionCall $block = $phpcsFile->findPrevious(T_DOC_COMMENT_OPEN_TAG, $argument['start']); } if (isset($block) === true && $tokens[$block]['level'] === $requiredLevel && isset($tokens[$block]['comment_tags']) === true) { if (isset($tokens[$block]['level']) === true && $tokens[$block]['level'] === $requiredLevel && isset($tokens[$block]['comment_tags']) === true ) { foreach ($tokens[$block]['comment_tags'] as $tag) { $strictStandard = $strictStandard || (strtolower($tokens[$tag]['content']) === '@deprecated'); } Loading coder_sniffer/Drupal/Sniffs/WhiteSpace/ObjectOperatorIndentSniff.php +2 −1 Original line number Diff line number Diff line Loading @@ -73,6 +73,7 @@ class ObjectOperatorIndentSniff implements Sniff // Check if the line before is in the same scope and go back if necessary. $scopeDiff = [$previousLine => $previousLine]; $startOfLine = $stackPtr; while (empty($scopeDiff) === false) { // Find the first non whitespace character on the previous line. $startOfLine = $this->findStartOfline($phpcsFile, $previousLine); Loading Loading
coder_sniffer/Drupal/Sniffs/Commenting/DocCommentSniff.php +1 −0 Original line number Diff line number Diff line Loading @@ -435,6 +435,7 @@ class DocCommentSniff implements Sniff foreach ($tagGroups as $group) { $maxLength = 0; $paddings = []; $pos = 0; foreach ($group as $pos => $tag) { $tagLength = strlen($tokens[$tag]['content']); if ($tagLength > $maxLength) { Loading
coder_sniffer/Drupal/Sniffs/Commenting/FunctionCommentSniff.php +3 −0 Original line number Diff line number Diff line Loading @@ -195,6 +195,7 @@ class FunctionCommentSniff implements Sniff $methodName = strtolower(ltrim($methodName, '_')); $return = null; $end = $stackPtr; foreach ($tokens[$commentStart]['comment_tags'] as $pos => $tag) { if ($tokens[$tag]['content'] === '@return') { if ($return !== null) { Loading Loading @@ -718,6 +719,8 @@ class FunctionCommentSniff implements Sniff } } $suggestedName = ''; $typeName = ''; if (count($typeNames) === 1) { $typeName = $param['type']; $suggestedName = static::suggestType($typeName); Loading
coder_sniffer/Drupal/Sniffs/Commenting/InlineCommentSniff.php +2 −1 Original line number Diff line number Diff line Loading @@ -217,6 +217,7 @@ class InlineCommentSniff implements Sniff }//end while $commentText = ''; $lastCommentToken = $stackPtr; foreach ($commentTokens as $lastCommentToken) { $comment = rtrim($tokens[$lastCommentToken]['content']); Loading
coder_sniffer/Drupal/Sniffs/Semantics/FunctionTriggerErrorSniff.php +5 −1 Original line number Diff line number Diff line Loading @@ -79,6 +79,7 @@ class FunctionTriggerErrorSniff extends FunctionCall // quotes away and possibly not report a faulty message. $messageText = substr($tokens[$messagePosition]['content'], 1, ($tokens[$messagePosition]['length'] - 2)); } else { $messageParts = []; // If not sprintf() then extract and store all the items except // whitespace, concatenation operators and comma. This will give all // real content such as concatenated strings and constants. Loading Loading @@ -112,7 +113,10 @@ class FunctionTriggerErrorSniff extends FunctionCall $block = $phpcsFile->findPrevious(T_DOC_COMMENT_OPEN_TAG, $argument['start']); } if (isset($block) === true && $tokens[$block]['level'] === $requiredLevel && isset($tokens[$block]['comment_tags']) === true) { if (isset($tokens[$block]['level']) === true && $tokens[$block]['level'] === $requiredLevel && isset($tokens[$block]['comment_tags']) === true ) { foreach ($tokens[$block]['comment_tags'] as $tag) { $strictStandard = $strictStandard || (strtolower($tokens[$tag]['content']) === '@deprecated'); } Loading
coder_sniffer/Drupal/Sniffs/WhiteSpace/ObjectOperatorIndentSniff.php +2 −1 Original line number Diff line number Diff line Loading @@ -73,6 +73,7 @@ class ObjectOperatorIndentSniff implements Sniff // Check if the line before is in the same scope and go back if necessary. $scopeDiff = [$previousLine => $previousLine]; $startOfLine = $stackPtr; while (empty($scopeDiff) === false) { // Find the first non whitespace character on the previous line. $startOfLine = $this->findStartOfline($phpcsFile, $previousLine); Loading