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()
132132 */
133133 protected function getStandardFiles ()
134134 {
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 );
137145
138146 $ standardFiles = array ();
139147 foreach ($ sniffs as $ sniff ) {
@@ -147,7 +155,7 @@ protected function getStandardFiles()
147155 }
148156 }
149157
150- $ standardFile = str_replace (' / Sniffs/ ' , ' / Docs/ ' , $ sniff );
158+ $ standardFile = str_replace (DIRECTORY_SEPARATOR . ' Sniffs ' . DIRECTORY_SEPARATOR , DIRECTORY_SEPARATOR . ' Docs ' . DIRECTORY_SEPARATOR , $ sniff );
151159 $ standardFile = str_replace ('Sniff.php ' , 'Standard.xml ' , $ standardFile );
152160
153161 if (is_file ($ standardFile ) === true ) {
You can’t perform that action at this time.
0 commit comments