Skip to content

Commit 447ee98

Browse files
committed
Changelog for bug #985 (fixed by PR #1131) + minor change to exclude code
1 parent 405ab6d commit 447ee98

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

CodeSniffer/Standards/Squiz/Sniffs/CSS/DuplicateClassDefinitionSniff.php

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -80,16 +80,11 @@ public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr)
8080
T_OPEN_TAG,
8181
);
8282

83-
$exclude = array(
84-
T_WHITESPACE,
85-
T_COMMENT,
86-
);
87-
8883
while ($next !== false) {
8984
$prev = $phpcsFile->findPrevious($find, ($next - 1));
9085

9186
// Check if an inner block was closed.
92-
$beforePrev = $phpcsFile->findPrevious($exclude, ($prev - 1), null, true);
87+
$beforePrev = $phpcsFile->findPrevious(PHP_CodeSniffer_Tokens::$emptyTokens, ($prev - 1), null, true);
9388
if ($beforePrev !== false
9489
&& $tokens[$beforePrev]['code'] === T_CLOSE_CURLY_BRACKET
9590
) {

package.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@ http://pear.php.net/dtd/package-2.0.xsd">
8181
-- The format of the PHP version is the same as the PHP_VERSION_ID constant (e.g., 50403 for version 5.4.3)
8282
-- Supported sniffs are Generic.PHP.DisallowAlternativePHPTags, PSR1.Classes.ClassDeclaration, Squiz.Commenting.FunctionComment
8383
-- Thanks to Finlay Beaton for the patch
84+
- Fixed bug #985 : Duplicate class definition detection generates false-positives in media queries
85+
-- Thanks to Raphael Horber for the patch
8486
- Fixed bug #1014 : Squiz VariableCommentSniff doesn't always detect a missing comment
8587
- Fixed bug #1066 : Undefined index: quiet in CLI.php during unit test run with -v command line arg
8688
- Fixed bug #1072 : Squiz.SelfMemberReference.NotUsed not detected if leading namespace separator is used

0 commit comments

Comments
 (0)