Loading .travis.yml +1 −0 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ matrix: - php: 7.1 - php: 7.2 - php: 7.3 - php: 7.4snapshot before_install: # Speed up build time by disabling Xdebug when its not needed. Loading coder_sniffer/Drupal/Sniffs/Commenting/FunctionCommentSniff.php +1 −1 Original line number Diff line number Diff line Loading @@ -438,7 +438,7 @@ class FunctionCommentSniff implements Sniff } // Starts with a capital letter and ends with a fullstop. $firstChar = $comment{0}; $firstChar = $comment[0]; if (strtoupper($firstChar) !== $firstChar) { $error = '@throws tag comment must start with a capital letter'; $phpcsFile->addError($error, $throwStart, 'ThrowsNotCapital'); Loading coder_sniffer/Drupal/Sniffs/Commenting/InlineCommentSniff.php +1 −1 Original line number Diff line number Diff line Loading @@ -147,7 +147,7 @@ class InlineCommentSniff implements Sniff } }//end if if ($tokens[$stackPtr]['content']{0} === '#') { if ($tokens[$stackPtr]['content'][0] === '#') { $error = 'Perl-style comments are not allowed; use "// Comment" instead'; $fix = $phpcsFile->addFixableError($error, $stackPtr, 'WrongStyle'); if ($fix === true) { Loading coder_sniffer/Drupal/Sniffs/NamingConventions/ValidGlobalSniff.php +1 −1 Original line number Diff line number Diff line Loading @@ -112,7 +112,7 @@ class ValidGlobalSniff implements Sniff while (($varToken = $phpcsFile->findNext($ignore, ($varToken + 1), null, true, null, true)) !== false) { if ($tokens[$varToken]['code'] === T_VARIABLE && in_array($tokens[$varToken]['content'], $this->coreGlobals) === false && $tokens[$varToken]['content']{1} !== '_' && $tokens[$varToken]['content'][1] !== '_' ) { $error = 'global variables should start with a single underscore followed by the module and another underscore'; $phpcsFile->addError($error, $varToken, 'GlobalUnderScore'); Loading coder_sniffer/Drupal/Sniffs/Semantics/FunctionTSniff.php +2 −2 Original line number Diff line number Diff line Loading @@ -118,7 +118,7 @@ class FunctionTSniff extends FunctionCall // Check if there is a backslash escaped single quote in the string and // if the string makes use of double quotes. if ($string{0} === "'" && strpos($string, "\'") !== false if ($string[0] === "'" && strpos($string, "\'") !== false && strpos($string, '"') === false ) { $warn = 'Avoid backslash escaping in translatable strings when possible, use "" quotes instead'; Loading @@ -126,7 +126,7 @@ class FunctionTSniff extends FunctionCall return; } if ($string{0} === '"' && strpos($string, '\"') !== false if ($string[0] === '"' && strpos($string, '\"') !== false && strpos($string, "'") === false ) { $warn = "Avoid backslash escaping in translatable strings when possible, use '' quotes instead"; Loading Loading
.travis.yml +1 −0 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ matrix: - php: 7.1 - php: 7.2 - php: 7.3 - php: 7.4snapshot before_install: # Speed up build time by disabling Xdebug when its not needed. Loading
coder_sniffer/Drupal/Sniffs/Commenting/FunctionCommentSniff.php +1 −1 Original line number Diff line number Diff line Loading @@ -438,7 +438,7 @@ class FunctionCommentSniff implements Sniff } // Starts with a capital letter and ends with a fullstop. $firstChar = $comment{0}; $firstChar = $comment[0]; if (strtoupper($firstChar) !== $firstChar) { $error = '@throws tag comment must start with a capital letter'; $phpcsFile->addError($error, $throwStart, 'ThrowsNotCapital'); Loading
coder_sniffer/Drupal/Sniffs/Commenting/InlineCommentSniff.php +1 −1 Original line number Diff line number Diff line Loading @@ -147,7 +147,7 @@ class InlineCommentSniff implements Sniff } }//end if if ($tokens[$stackPtr]['content']{0} === '#') { if ($tokens[$stackPtr]['content'][0] === '#') { $error = 'Perl-style comments are not allowed; use "// Comment" instead'; $fix = $phpcsFile->addFixableError($error, $stackPtr, 'WrongStyle'); if ($fix === true) { Loading
coder_sniffer/Drupal/Sniffs/NamingConventions/ValidGlobalSniff.php +1 −1 Original line number Diff line number Diff line Loading @@ -112,7 +112,7 @@ class ValidGlobalSniff implements Sniff while (($varToken = $phpcsFile->findNext($ignore, ($varToken + 1), null, true, null, true)) !== false) { if ($tokens[$varToken]['code'] === T_VARIABLE && in_array($tokens[$varToken]['content'], $this->coreGlobals) === false && $tokens[$varToken]['content']{1} !== '_' && $tokens[$varToken]['content'][1] !== '_' ) { $error = 'global variables should start with a single underscore followed by the module and another underscore'; $phpcsFile->addError($error, $varToken, 'GlobalUnderScore'); Loading
coder_sniffer/Drupal/Sniffs/Semantics/FunctionTSniff.php +2 −2 Original line number Diff line number Diff line Loading @@ -118,7 +118,7 @@ class FunctionTSniff extends FunctionCall // Check if there is a backslash escaped single quote in the string and // if the string makes use of double quotes. if ($string{0} === "'" && strpos($string, "\'") !== false if ($string[0] === "'" && strpos($string, "\'") !== false && strpos($string, '"') === false ) { $warn = 'Avoid backslash escaping in translatable strings when possible, use "" quotes instead'; Loading @@ -126,7 +126,7 @@ class FunctionTSniff extends FunctionCall return; } if ($string{0} === '"' && strpos($string, '\"') !== false if ($string[0] === '"' && strpos($string, '\"') !== false && strpos($string, "'") === false ) { $warn = "Avoid backslash escaping in translatable strings when possible, use '' quotes instead"; Loading