Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Squiz.CSS.DuplicateClassDefinitionSniff #2639

Merged
merged 1 commit into from Oct 30, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -88,6 +88,7 @@ public function process(File $phpcsFile, $stackPtr)
$name = trim($name);
$name = str_replace("\n", ' ', $name);
$name = preg_replace('|[\s]+|', ' ', $name);
$name = preg_replace('|\s*/\*.*\*/\s*|', '', $name);
$name = str_replace(', ', ',', $name);

$names = explode(',', $name);
Expand Down
30 changes: 30 additions & 0 deletions src/Standards/Squiz/Tests/CSS/DuplicateClassDefinitionUnitTest.css
Expand Up @@ -71,3 +71,33 @@

.foo /* any comment */
{ color: red; }

/* print comment */
@media print {
/* any comment */
td {
}

/* any comment */
img {
}

/* any comment */
td {
}
}

@media handheld /* handheld comment */
{
td /* any comment */
{
}

img /* any comment */
{
}

td /* any comment */
{
}
}
Expand Up @@ -26,9 +26,11 @@ class DuplicateClassDefinitionUnitTest extends AbstractSniffUnitTest
public function getErrorList()
{
return [
9 => 1,
29 => 1,
57 => 1,
9 => 1,
29 => 1,
57 => 1,
86 => 1,
101 => 1,
];

}//end getErrorList()
Expand Down