42 private $extensions = [
56 $this->rulesetDir = $rulesetDir;
57 if (!file_exists($rulesetDir) && file_exists($fullPath = realpath(
__DIR__ .
'/../../../../' . $rulesetDir))) {
58 $this->rulesetDir = $fullPath;
60 $this->reportFile = $reportFile;
61 $this->wrapper = $wrapper;
69 $this->extensions = $extensions;
85 public function run(array $whiteList)
87 if (empty($whiteList)) {
91 if (!defined(
'PHP_CODESNIFFER_IN_TESTS')) {
92 define(
'PHP_CODESNIFFER_IN_TESTS',
true);
95 $this->wrapper->checkRequirements();
98 $settings[
'standards'] = [$this->rulesetDir];
99 $settings[
'extensions'] = $this->extensions;
101 $settings[
'reports'][
'full'] = $this->reportFile;
105 $result = $this->wrapper->runPHPCS();
defined('TESTS_BP')||define('TESTS_BP' __DIR__