Closed
Description
Steps to reproduce
Invoke phpcs on the test code:
phpcs --standard=Squiz -s --sniffs=Squiz.CSS.DuplicateClassDefinition [FILE]
Test code
.foo /* any comment */
{ color: red; }
Produces output
FILE: test.css
---------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
---------------------------------------------------------------------------------
1 | ERROR | An error occurred during processing; checking has been aborted. The
| | error message was: Uninitialized string offset: 0 in
| | /.../git/PHP_CodeSniffer/src/Standards/Squiz/Sniffs/CSS/DuplicateClassDefinitionSniff.php
| | on line 98 (Internal.Exception)
---------------------------------------------------------------------------------
Time: 77ms; Memory: 8Mb
Expected output
No output. No duplicate class definitions should be found.
Found in phpcs version 276f561 (2017-09-15)
Note: The amount of whitespace surrounding the comment doesn't seem to affect whether this happens. Can be on the same line.