File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed
CodeSniffer/DocGenerators Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -132,8 +132,16 @@ public function generate()
132
132
*/
133
133
protected function getStandardFiles ()
134
134
{
135
- $ standardDir = realpath (dirname (__FILE__ ).'/../Standards/ ' .$ this ->_standard );
136
- $ sniffs = PHP_CodeSniffer::getSniffFiles ($ standardDir , $ this ->_standard );
135
+ if (is_dir ($ this ->_standard ) === true ) {
136
+ // This is a custom standard.
137
+ $ standardDir = $ this ->_standard ;
138
+ $ standard = basename ($ this ->_standard );
139
+ } else {
140
+ $ standardDir = realpath (dirname (__FILE__ ).'/../Standards/ ' .$ this ->_standard );
141
+ $ standard = $ this ->_standard ;
142
+ }
143
+
144
+ $ sniffs = PHP_CodeSniffer::getSniffFiles ($ standardDir , $ standard );
137
145
138
146
$ standardFiles = array ();
139
147
foreach ($ sniffs as $ sniff ) {
@@ -147,7 +155,7 @@ protected function getStandardFiles()
147
155
}
148
156
}
149
157
150
- $ standardFile = str_replace (' / Sniffs/ ' , ' / Docs/ ' , $ sniff );
158
+ $ standardFile = str_replace (DIRECTORY_SEPARATOR . ' Sniffs ' . DIRECTORY_SEPARATOR , DIRECTORY_SEPARATOR . ' Docs ' . DIRECTORY_SEPARATOR , $ sniff );
151
159
$ standardFile = str_replace ('Sniff.php ' , 'Standard.xml ' , $ standardFile );
152
160
153
161
if (is_file ($ standardFile ) === true ) {
You can’t perform that action at this time.
0 commit comments