File tree Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Original file line number Diff line number Diff line change 66 * in a standard.
77 *
88 * @author Greg Sherwood <gsherwood@squiz.net>
9+ * @author Juliette Reinders Folmer <phpcs_nospam@adviesenzo.nl>
910 * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600)
11+ * @copyright 2024 PHPCSStandards and contributors
1012 * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence
1113 */
1214
@@ -46,14 +48,18 @@ public function __construct(Ruleset $ruleset)
4648 {
4749 $ this ->ruleset = $ ruleset ;
4850
51+ $ find = [
52+ DIRECTORY_SEPARATOR .'Sniffs ' .DIRECTORY_SEPARATOR ,
53+ 'Sniff.php ' ,
54+ ];
55+ $ replace = [
56+ DIRECTORY_SEPARATOR .'Docs ' .DIRECTORY_SEPARATOR ,
57+ 'Standard.xml ' ,
58+ ];
59+
4960 foreach ($ ruleset ->sniffs as $ className => $ sniffClass ) {
5061 $ file = Autoload::getLoadedFileName ($ className );
51- $ docFile = str_replace (
52- DIRECTORY_SEPARATOR .'Sniffs ' .DIRECTORY_SEPARATOR ,
53- DIRECTORY_SEPARATOR .'Docs ' .DIRECTORY_SEPARATOR ,
54- $ file
55- );
56- $ docFile = str_replace ('Sniff.php ' , 'Standard.xml ' , $ docFile );
62+ $ docFile = str_replace ($ find , $ replace , $ file );
5763
5864 if (is_file ($ docFile ) === true ) {
5965 $ this ->docFiles [] = $ docFile ;
You can’t perform that action at this time.
0 commit comments