Skip to content

Commit e9420b9

Browse files
authored
Merge pull request #33 from ADmad/patch-1
Fix error thrown by phpcs when it finds phpcs.xml
2 parents 61af44f + e884652 commit e9420b9

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Annotator/AbstractAnnotator.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,11 @@ protected function _getFile($file, $content = null) {
9898

9999
$phpcs = new Runner();
100100

101-
$config = new Config();
101+
if (!defined('PHP_CODESNIFFER_CBF')) {
102+
define('PHP_CODESNIFFER_CBF', false);
103+
}
104+
// Explictly specifying standard prevents it from searching for phpcs.xml type files.
105+
$config = new Config(['--standard=PSR2']);
102106
$phpcs->config = $config;
103107
$phpcs->init();
104108

0 commit comments

Comments
 (0)