-
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ORGA-2151 generate trend result file in json to allow later formatting (
#121)
- Loading branch information
1 parent
84f6432
commit c7f66e7
Showing
4 changed files
with
209 additions
and
35 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?php | ||
|
||
namespace staabm\PHPStanBaselineAnalysis; | ||
|
||
final class TrendResult | ||
{ | ||
public string $headline; | ||
|
||
/** | ||
* @var array<ResultPrinter::KEY_*, array{reference: int, comparing: int, trend: string}> | ||
*/ | ||
public array $results; | ||
|
||
public function __construct(string $headline) | ||
{ | ||
$this->headline = $headline; | ||
$this->results = []; | ||
} | ||
|
||
/** | ||
* @param ResultPrinter::KEY_* $key | ||
* @param int $referenceValue | ||
* @param int $comparingValue | ||
* @return void | ||
*/ | ||
public function setKey(string $key, $referenceValue, $comparingValue, string $trend): void | ||
{ | ||
$this->results[$key] = [ | ||
'reference' => $referenceValue, | ||
'comparing' => $comparingValue, | ||
'trend' => $trend, | ||
]; | ||
} | ||
} |
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