diff --git a/CodeSniffer/DocGenerators/Generator.php b/CodeSniffer/DocGenerators/Generator.php index 8cb38c605f..e686549be4 100644 --- a/CodeSniffer/DocGenerators/Generator.php +++ b/CodeSniffer/DocGenerators/Generator.php @@ -132,15 +132,18 @@ public function generate() protected function getStandardFiles() { $phpcs = new PHP_CodeSniffer(); - $sniffs = $phpcs->processRuleset($this->_standard); + $phpcs->process(array(), $this->_standard); + $sniffs = $phpcs->getSniffs(); $standardFiles = array(); - foreach ($sniffs as $sniff) { + foreach ($sniffs as $className => $sniffClass) { + $object = new ReflectionObject($sniffClass); + $sniff = $object->getFilename(); if (empty($this->_sniffs) === false) { // We are limiting the docs to certain sniffs only, so filter // out any unwanted sniffs. - $sniffName = substr($sniff, (strrpos($sniff, '/') + 1)); - $sniffName = substr($sniffName, 0, -9); + $parts = explode('_', $className); + $sniffName = $parts[0].'.'.$parts[2].'.'.substr($parts[3], 0, -5); if (in_array($sniffName, $this->_sniffs) === false) { continue; } diff --git a/CodeSniffer/DocGenerators/HTML.php b/CodeSniffer/DocGenerators/HTML.php index f379d9414d..4eab2308d2 100644 --- a/CodeSniffer/DocGenerators/HTML.php +++ b/CodeSniffer/DocGenerators/HTML.php @@ -186,12 +186,12 @@ protected function printToc($standardFiles) */ protected function printFooter() { - // Turn off strict errors so we don't get timezone warnings if people + // Turn off errors so we don't get timezone warnings if people // don't have their timezone set. - error_reporting(E_ALL); + error_reporting(0); echo '