-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #136 from DaveLiddament/feature/results-parsesrs-c…
…an-report-sa-tool-failure ADD ability for results parser to throw exception if SA tool reports errors
- Loading branch information
Showing
15 changed files
with
241 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
src/Domain/ResultsParser/ErrorReportedByStaticAnalysisTool.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
|
||
/** | ||
* Static Analysis Results Baseliner (sarb). | ||
* | ||
* (c) Dave Liddament | ||
* | ||
* For the full copyright and licence information please view the LICENSE file distributed with this source code. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace DaveLiddament\StaticAnalysisResultsBaseliner\Domain\ResultsParser; | ||
|
||
use DaveLiddament\StaticAnalysisResultsBaseliner\Domain\Common\SarbException; | ||
|
||
/** | ||
* Thrown if the static analysis tool reports an error. | ||
*/ | ||
final class ErrorReportedByStaticAnalysisTool extends SarbException | ||
{ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
tests/resources/phpstan/phpstan-invalid-errors-not-strings.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
{ | ||
"totals": { | ||
"errors": 0, | ||
"file_errors": 3 | ||
}, | ||
"files": { | ||
"/vagrant/static-analysis-baseliner/src/Domain/BaseLiner/BaseLineImporter.php": { | ||
"errors": 1, | ||
"messages": [ | ||
{ | ||
"message": "Parameter #1 $array of static method DaveLiddament\\StaticAnalysisResultsBaseliner\\Domain\\ResultsParser\\AnalysisResults::fromArray() expects int, array given.", | ||
"line": 89, | ||
"ignorable": true, | ||
"relativePath": "Domain/BaseLiner/BaseLineImporter.php" | ||
} | ||
] | ||
}, | ||
"/vagrant/static-analysis-baseliner/src/Domain/ResultsParser/AnalysisResults.php": { | ||
"errors": 2, | ||
"messages": [ | ||
{ | ||
"message": "PHPDoc tag @param for parameter $array with type array is incompatible with native type int", | ||
"line": 73, | ||
"ignorable": true, | ||
"relativePath": "Domain/ResultsParser/AnalysisResults.php" | ||
}, | ||
{ | ||
"message": "Argument of an invalid type int supplied for foreach, only iterables are supported.", | ||
"line": null, | ||
"ignorable": true, | ||
"relativePath": "Domain/ResultsParser/AnalysisResults.php" | ||
} | ||
] | ||
} | ||
}, | ||
"errors": [ | ||
"Error 1", | ||
1, | ||
true | ||
] | ||
} |
36 changes: 36 additions & 0 deletions
36
tests/resources/phpstan/phpstan-invalid-missing-errors.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
{ | ||
"totals": { | ||
"errors": 0, | ||
"file_errors": 3 | ||
}, | ||
"files": { | ||
"/vagrant/static-analysis-baseliner/src/Domain/BaseLiner/BaseLineImporter.php": { | ||
"errors": 1, | ||
"messages": [ | ||
{ | ||
"message": "Parameter #1 $array of static method DaveLiddament\\StaticAnalysisResultsBaseliner\\Domain\\ResultsParser\\AnalysisResults::fromArray() expects int, array given.", | ||
"line": 89, | ||
"ignorable": true, | ||
"relativePath": "Domain/BaseLiner/BaseLineImporter.php" | ||
} | ||
] | ||
}, | ||
"/vagrant/static-analysis-baseliner/src/Domain/ResultsParser/AnalysisResults.php": { | ||
"errors": 2, | ||
"messages": [ | ||
{ | ||
"message": "PHPDoc tag @param for parameter $array with type array is incompatible with native type int", | ||
"line": 73, | ||
"ignorable": true, | ||
"relativePath": "Domain/ResultsParser/AnalysisResults.php" | ||
}, | ||
{ | ||
"message": "Argument of an invalid type int supplied for foreach, only iterables are supported.", | ||
"line": null, | ||
"ignorable": true, | ||
"relativePath": "Domain/ResultsParser/AnalysisResults.php" | ||
} | ||
] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
{ | ||
"totals": { | ||
"errors": 0, | ||
"file_errors": 3 | ||
}, | ||
"files": { | ||
"/vagrant/static-analysis-baseliner/src/Domain/BaseLiner/BaseLineImporter.php": { | ||
"errors": 1, | ||
"messages": [ | ||
{ | ||
"message": "Parameter #1 $array of static method DaveLiddament\\StaticAnalysisResultsBaseliner\\Domain\\ResultsParser\\AnalysisResults::fromArray() expects int, array given.", | ||
"line": 89, | ||
"ignorable": true, | ||
"relativePath": "Domain/BaseLiner/BaseLineImporter.php" | ||
} | ||
] | ||
}, | ||
"/vagrant/static-analysis-baseliner/src/Domain/ResultsParser/AnalysisResults.php": { | ||
"errors": 2, | ||
"messages": [ | ||
{ | ||
"message": "PHPDoc tag @param for parameter $array with type array is incompatible with native type int", | ||
"line": 73, | ||
"ignorable": true, | ||
"relativePath": "Domain/ResultsParser/AnalysisResults.php" | ||
}, | ||
{ | ||
"message": "Argument of an invalid type int supplied for foreach, only iterables are supported.", | ||
"line": null, | ||
"ignorable": true, | ||
"relativePath": "Domain/ResultsParser/AnalysisResults.php" | ||
} | ||
] | ||
} | ||
}, | ||
"errors": [ | ||
"Error 1", | ||
"Error 2" | ||
] | ||
} |