Skip to content

Commit 73aab03

Browse files
author
Carles Mata
authored
Merge pull request #7 from marcorosello/master
Fix xml output
2 parents 13333e3 + c27d1a6 commit 73aab03

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

lint/linter/PhpstanLinter.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ protected function getMandatoryFlags()
8787
$flags = array(
8888
'analyse',
8989
'--no-progress',
90-
'--errorFormat=raw'
90+
'--errorFormat=checkstyle'
9191
);
9292
if (null !== $this->configFile) {
9393
array_push($flags, '-c', $this->configFile);
@@ -153,6 +153,7 @@ protected function parseLinterOutput($path, $err, $stdout, $stderr)
153153
{
154154
$result = array();
155155
if (!empty($stdout)) {
156+
$stdout = substr($stdout, strpos($stdout, '<?xml'));
156157
$checkstyleOutpout = new SimpleXMLElement($stdout);
157158
$errors = $checkstyleOutpout->xpath('//file/error');
158159
foreach($errors as $error) {

0 commit comments

Comments
 (0)