Skip to content

Commit aad849c

Browse files
committed
Clearer error message for when the sniff class name does not match the directory structure
1 parent 651a757 commit aad849c

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

CodeSniffer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ public static function autoload($className)
281281
&& is_file(dirname(self::$standardDir).'/'.$path) === true
282282
) {
283283
// Check standard file locations based on the passed standard directory.
284-
include dirname(self::$standardDir).'/'.$path;
284+
include_once dirname(self::$standardDir).'/'.$path;
285285
} else {
286286
// Everything else.
287287
@include $path;

package.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ http://pear.php.net/dtd/package-2.0.xsd">
3939
-- Thanks to Maik Penz for the patch
4040
- Docs added for the entire Generic standard, and many sniffs from other standards are now documented as well
4141
-- Thanks to Spencer Rinehart for the contribution
42+
- Clearer error message for when the sniff class name does not match the directory structure
4243
- Generated HTML docs now correctly show the open PHP tag in code comparison blocks
4344
- Added Generic InlineHTMLSniff to ensure a file only contains PHP code
4445
- Added Squiz ShorthandSizeSniff to check that CSS sizes are using shorthand notation only when 1 or 2 values are used

0 commit comments

Comments
 (0)