File tree 1 file changed +12
-6
lines changed
1 file changed +12
-6
lines changed Original file line number Diff line number Diff line change 6
6
* in a standard.
7
7
*
8
8
* @author Greg Sherwood <gsherwood@squiz.net>
9
+ * @author Juliette Reinders Folmer <phpcs_nospam@adviesenzo.nl>
9
10
* @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600)
11
+ * @copyright 2024 PHPCSStandards and contributors
10
12
* @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence
11
13
*/
12
14
@@ -46,14 +48,18 @@ public function __construct(Ruleset $ruleset)
46
48
{
47
49
$ this ->ruleset = $ ruleset ;
48
50
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
+
49
60
foreach ($ ruleset ->sniffs as $ className => $ sniffClass ) {
50
61
$ 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 );
57
63
58
64
if (is_file ($ docFile ) === true ) {
59
65
$ this ->docFiles [] = $ docFile ;
You can’t perform that action at this time.
0 commit comments