Skip to content

Commit 90ea70c

Browse files
authored
Merge pull request #308 from PHPCSStandards/feature/runner-allow-phpcbf-with-performance-report
Runner: allow the Performance report when running `phpcbf`
2 parents 6da9eeb + e59ef4b commit 90ea70c

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/Runner.php

+9-1
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,15 @@ public function runPHPCBF()
194194
$this->config->showSources = false;
195195
$this->config->recordErrors = false;
196196
$this->config->reportFile = null;
197-
$this->config->reports = ['cbf' => null];
197+
198+
// Only use the "Cbf" report, but allow for the Performance report as well.
199+
$originalReports = array_change_key_case($this->config->reports, CASE_LOWER);
200+
$newReports = ['cbf' => null];
201+
if (array_key_exists('performance', $originalReports) === true) {
202+
$newReports['performance'] = $originalReports['performance'];
203+
}
204+
205+
$this->config->reports = $newReports;
198206

199207
// If a standard tries to set command line arguments itself, some
200208
// may be blocked because PHPCBF is running, so stop the script

0 commit comments

Comments
 (0)