Skip to content

Commit

Permalink
Mark all methods that never return as such
Browse files Browse the repository at this point in the history
This should allow static analyzers to understand better why methods
calling these methods also never return.
  • Loading branch information
greg0ire authored and sebastianbergmann committed Apr 24, 2020
1 parent 8474e22 commit ac702d7
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Framework/Assert.php
Original file line number Diff line number Diff line change
Expand Up @@ -3460,6 +3460,8 @@ public static function getObjectAttribute($object, string $attributeName)
* Mark the test as incomplete.
*
* @throws IncompleteTestError
*
* @psalm-return never-return
*/
public static function markTestIncomplete(string $message = ''): void
{
Expand All @@ -3471,6 +3473,8 @@ public static function markTestIncomplete(string $message = ''): void
*
* @throws SkippedTestError
* @throws SyntheticSkippedError
*
* @psalm-return never-return
*/
public static function markTestSkipped(string $message = ''): void
{
Expand Down
2 changes: 2 additions & 0 deletions src/Framework/Constraint/Constraint.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ protected function matches($other): bool
*
* @throws ExpectationFailedException
* @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
*
* @psalm-return never-return
*/
protected function fail($other, $description, ComparisonFailure $comparisonFailure = null): void
{
Expand Down
2 changes: 2 additions & 0 deletions src/Framework/Constraint/JsonMatches.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ protected function matches($other): bool
* @throws ExpectationFailedException
* @throws \PHPUnit\Framework\Exception
* @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
*
* @psalm-return never-return
*/
protected function fail($other, $description, ComparisonFailure $comparisonFailure = null): void
{
Expand Down
2 changes: 2 additions & 0 deletions src/Framework/TestSuite.php
Original file line number Diff line number Diff line change
Expand Up @@ -668,6 +668,8 @@ public function setTests(array $tests): void
* @param string $message
*
* @throws SkippedTestSuiteError
*
* @psalm-return never-return
*/
public function markTestSuiteSkipped($message = ''): void
{
Expand Down
2 changes: 2 additions & 0 deletions src/Framework/WarningTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ public function toString(): string

/**
* @throws Exception
*
* @psalm-return never-return
*/
protected function runTest(): void
{
Expand Down

0 comments on commit ac702d7

Please sign in to comment.