Skip to content

Commit

Permalink
fix PHPstan
Browse files Browse the repository at this point in the history
  • Loading branch information
ShockedPlot7560 committed Dec 18, 2023
1 parent 4b41737 commit 4774868
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/framework/result/printer/TestResultsBag.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,18 @@
use ShockedPlot7560\PmmpUnit\framework\result\TestResult;

class TestResultsBag {
/** @var TestResult[] $fatalErrors */
/** @var FatalTest[] $fatalErrors */
private array $fatalErrors = [];

/** @var TestResult[] $failedTests */
/** @var FailedTest[] $failedTests */
private array $failedTests = [];

/** @var TestResult[] $successTests */
/** @var SuccessTest[] $passedTests */
private array $passedTests = [];

/**
* @param TestResult[] $testResults
*/
public function __construct(
private array $testResults
) {
Expand Down Expand Up @@ -95,6 +98,9 @@ public function getFatalRate() : float {
return round(count($this->fatalErrors) / count($this->testResults) * 100, 2);
}

/**
* @return TestResult[]
*/
public function getAllErrors() : array {
return array_merge($this->failedTests, $this->fatalErrors);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
use ShockedPlot7560\PmmpUnit\framework\TestCase;

class PromiseRejectionNotHandledTest extends TestCase {
/** @phpstan-return PromiseInterface<null> */
public function testPromiseRejectedToException() : PromiseInterface {
$this->expectException(Exception::class);

Expand Down

0 comments on commit 4774868

Please sign in to comment.