[ticket/13381] Allow ' *' in the doc blocks (especially the header files)

PHPBB3-13381
This commit is contained in:
Tristan Darricau 2014-11-27 11:20:26 +01:00
parent d43e8c94f5
commit 79ce924bc1

View file

@ -84,12 +84,12 @@ class phpbb_Sniffs_Commenting_FileCommentSniff implements PHP_CodeSniffer_Sniff
$line = $tokens[$i]['content']; $line = $tokens[$i]['content'];
// Check that each line starts with a '*' // Check that each line starts with a '*'
if (substr($line, 0, 1) !== '*') if (substr($line, 0, 1) !== '*' && substr($line, 0, 2) !== ' *')
{ {
$message = 'The file doc comment should not be idented.'; $message = 'The file doc comment should not be indented.';
$phpcsFile->addWarning($message, $i); $phpcsFile->addWarning($message, $i);
} }
else if (preg_match('/^\*\s+@([\w]+)\s+(.*)$/', $line, $match) !== 0) else if (preg_match('/^[ ]?\*\s+@([\w]+)\s+(.*)$/', $line, $match) !== 0)
{ {
if (!isset($tags[$match[1]])) if (!isset($tags[$match[1]]))
{ {