Skip to content

Commit

Permalink
Docs: add missing return type void annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
jrfnl committed Dec 14, 2023
1 parent 640295c commit c6ae986
Show file tree
Hide file tree
Showing 9 changed files with 114 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Polyfills/ExpectException.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ trait ExpectException {
* Clear any stored exception information between each test.
*
* @after
*
* @return void
*/
public function clearExceptionInfo() {
$this->exceptionMessage = '';
Expand Down
20 changes: 20 additions & 0 deletions src/TestListeners/TestListenerDefaultImplementationPHPUnit6.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ trait TestListenerDefaultImplementation {
* @param Test $test Test object.
* @param Exception $e Instance of the error encountered.
* @param float $time Execution time of this test.
*
* @return void
*/
public function addError( Test $test, Exception $e, $time ) {
$this->add_error( $test, $e, $time );
Expand All @@ -40,6 +42,8 @@ public function addError( Test $test, Exception $e, $time ) {
* @param Test $test Test object.
* @param Warning $e Instance of the warning encountered.
* @param float $time Execution time of this test.
*
* @return void
*/
public function addWarning( Test $test, Warning $e, $time ) {
$this->add_warning( $test, $e, $time );
Expand All @@ -51,6 +55,8 @@ public function addWarning( Test $test, Warning $e, $time ) {
* @param Test $test Test object.
* @param AssertionFailedError $e Instance of the assertion failure exception encountered.
* @param float $time Execution time of this test.
*
* @return void
*/
public function addFailure( Test $test, AssertionFailedError $e, $time ) {
$this->add_failure( $test, $e, $time );
Expand All @@ -62,6 +68,8 @@ public function addFailure( Test $test, AssertionFailedError $e, $time ) {
* @param Test $test Test object.
* @param Exception $e Instance of the incomplete test exception.
* @param float $time Execution time of this test.
*
* @return void
*/
public function addIncompleteTest( Test $test, Exception $e, $time ) {
$this->add_incomplete_test( $test, $e, $time );
Expand All @@ -73,6 +81,8 @@ public function addIncompleteTest( Test $test, Exception $e, $time ) {
* @param Test $test Test object.
* @param Exception $e Instance of the risky test exception.
* @param float $time Execution time of this test.
*
* @return void
*/
public function addRiskyTest( Test $test, Exception $e, $time ) {
$this->add_risky_test( $test, $e, $time );
Expand All @@ -84,6 +94,8 @@ public function addRiskyTest( Test $test, Exception $e, $time ) {
* @param Test $test Test object.
* @param Exception $e Instance of the skipped test exception.
* @param float $time Execution time of this test.
*
* @return void
*/
public function addSkippedTest( Test $test, Exception $e, $time ) {
$this->add_skipped_test( $test, $e, $time );
Expand All @@ -93,6 +105,8 @@ public function addSkippedTest( Test $test, Exception $e, $time ) {
* A test suite started.
*
* @param TestSuite $suite Test suite object.
*
* @return void
*/
public function startTestSuite( TestSuite $suite ) {
$this->start_test_suite( $suite );
Expand All @@ -102,6 +116,8 @@ public function startTestSuite( TestSuite $suite ) {
* A test suite ended.
*
* @param TestSuite $suite Test suite object.
*
* @return void
*/
public function endTestSuite( TestSuite $suite ) {
$this->end_test_suite( $suite );
Expand All @@ -111,6 +127,8 @@ public function endTestSuite( TestSuite $suite ) {
* A test started.
*
* @param Test $test Test object.
*
* @return void
*/
public function startTest( Test $test ) {
$this->start_test( $test );
Expand All @@ -121,6 +139,8 @@ public function startTest( Test $test ) {
*
* @param Test $test Test object.
* @param float $time Execution time of this test.
*
* @return void
*/
public function endTest( Test $test, $time ) {
$this->end_test( $test, $time );
Expand Down
20 changes: 20 additions & 0 deletions src/TestListeners/TestListenerDefaultImplementationPHPUnitGte7.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ trait TestListenerDefaultImplementation {
* @param Test $test Test object.
* @param Throwable $t Instance of the error encountered.
* @param float $time Execution time of this test.
*
* @return void
*/
public function addError( Test $test, Throwable $t, float $time ): void {
$this->add_error( $test, $t, $time );
Expand All @@ -40,6 +42,8 @@ public function addError( Test $test, Throwable $t, float $time ): void {
* @param Test $test Test object.
* @param Warning $e Instance of the warning encountered.
* @param float $time Execution time of this test.
*
* @return void
*/
public function addWarning( Test $test, Warning $e, float $time ): void {
$this->add_warning( $test, $e, $time );
Expand All @@ -51,6 +55,8 @@ public function addWarning( Test $test, Warning $e, float $time ): void {
* @param Test $test Test object.
* @param AssertionFailedError $e Instance of the assertion failure exception encountered.
* @param float $time Execution time of this test.
*
* @return void
*/
public function addFailure( Test $test, AssertionFailedError $e, float $time ): void {
$this->add_failure( $test, $e, $time );
Expand All @@ -62,6 +68,8 @@ public function addFailure( Test $test, AssertionFailedError $e, float $time ):
* @param Test $test Test object.
* @param Throwable $t Instance of the incomplete test exception.
* @param float $time Execution time of this test.
*
* @return void
*/
public function addIncompleteTest( Test $test, Throwable $t, float $time ): void {
$this->add_incomplete_test( $test, $t, $time );
Expand All @@ -73,6 +81,8 @@ public function addIncompleteTest( Test $test, Throwable $t, float $time ): void
* @param Test $test Test object.
* @param Throwable $t Instance of the risky test exception.
* @param float $time Execution time of this test.
*
* @return void
*/
public function addRiskyTest( Test $test, Throwable $t, float $time ): void {
$this->add_risky_test( $test, $t, $time );
Expand All @@ -84,6 +94,8 @@ public function addRiskyTest( Test $test, Throwable $t, float $time ): void {
* @param Test $test Test object.
* @param Throwable $t Instance of the skipped test exception.
* @param float $time Execution time of this test.
*
* @return void
*/
public function addSkippedTest( Test $test, Throwable $t, float $time ): void {
$this->add_skipped_test( $test, $t, $time );
Expand All @@ -93,6 +105,8 @@ public function addSkippedTest( Test $test, Throwable $t, float $time ): void {
* A test suite started.
*
* @param TestSuite $suite Test suite object.
*
* @return void
*/
public function startTestSuite( TestSuite $suite ): void {
$this->start_test_suite( $suite );
Expand All @@ -102,6 +116,8 @@ public function startTestSuite( TestSuite $suite ): void {
* A test suite ended.
*
* @param TestSuite $suite Test suite object.
*
* @return void
*/
public function endTestSuite( TestSuite $suite ): void {
$this->end_test_suite( $suite );
Expand All @@ -111,6 +127,8 @@ public function endTestSuite( TestSuite $suite ): void {
* A test started.
*
* @param Test $test Test object.
*
* @return void
*/
public function startTest( Test $test ): void {
$this->start_test( $test );
Expand All @@ -121,6 +139,8 @@ public function startTest( Test $test ): void {
*
* @param Test $test Test object.
* @param float $time Execution time of this test.
*
* @return void
*/
public function endTest( Test $test, float $time ): void {
$this->end_test( $test, $time );
Expand Down
20 changes: 20 additions & 0 deletions src/TestListeners/TestListenerDefaultImplementationPHPUnitLte5.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ trait TestListenerDefaultImplementation {
* @param PHPUnit_Framework_Test $test Test object.
* @param Exception $e Instance of the error encountered.
* @param float $time Execution time of this test.
*
* @return void
*/
public function addError( PHPUnit_Framework_Test $test, Exception $e, $time ) {
$this->add_error( $test, $e, $time );
Expand All @@ -46,6 +48,8 @@ public function addError( PHPUnit_Framework_Test $test, Exception $e, $time ) {
* @param PHPUnit_Framework_Test $test Test object.
* @param PHPUnit_Framework_Warning $e Instance of the warning encountered.
* @param float $time Execution time of this test.
*
* @return void
*/
public function addWarning( PHPUnit_Framework_Test $test, PHPUnit_Framework_Warning $e, $time ) {
$this->add_warning( $test, $e, $time );
Expand All @@ -58,6 +62,8 @@ public function addWarning( PHPUnit_Framework_Test $test, PHPUnit_Framework_Warn
* @param PHPUnit_Framework_AssertionFailedError $e Instance of the assertion failure
* exception encountered.
* @param float $time Execution time of this test.
*
* @return void
*/
public function addFailure( PHPUnit_Framework_Test $test, PHPUnit_Framework_AssertionFailedError $e, $time ) {
$this->add_failure( $test, $e, $time );
Expand All @@ -69,6 +75,8 @@ public function addFailure( PHPUnit_Framework_Test $test, PHPUnit_Framework_Asse
* @param PHPUnit_Framework_Test $test Test object.
* @param Exception $e Instance of the incomplete test exception.
* @param float $time Execution time of this test.
*
* @return void
*/
public function addIncompleteTest( PHPUnit_Framework_Test $test, Exception $e, $time ) {
$this->add_incomplete_test( $test, $e, $time );
Expand All @@ -80,6 +88,8 @@ public function addIncompleteTest( PHPUnit_Framework_Test $test, Exception $e, $
* @param PHPUnit_Framework_Test $test Test object.
* @param Exception $e Instance of the risky test exception.
* @param float $time Execution time of this test.
*
* @return void
*/
public function addRiskyTest( PHPUnit_Framework_Test $test, Exception $e, $time ) {
$this->add_risky_test( $test, $e, $time );
Expand All @@ -91,6 +101,8 @@ public function addRiskyTest( PHPUnit_Framework_Test $test, Exception $e, $time
* @param PHPUnit_Framework_Test $test Test object.
* @param Exception $e Instance of the skipped test exception.
* @param float $time Execution time of this test.
*
* @return void
*/
public function addSkippedTest( PHPUnit_Framework_Test $test, Exception $e, $time ) {
$this->add_skipped_test( $test, $e, $time );
Expand All @@ -100,6 +112,8 @@ public function addSkippedTest( PHPUnit_Framework_Test $test, Exception $e, $tim
* A test suite started.
*
* @param PHPUnit_Framework_TestSuite $suite Test suite object.
*
* @return void
*/
public function startTestSuite( PHPUnit_Framework_TestSuite $suite ) {
$this->start_test_suite( $suite );
Expand All @@ -109,6 +123,8 @@ public function startTestSuite( PHPUnit_Framework_TestSuite $suite ) {
* A test suite ended.
*
* @param PHPUnit_Framework_TestSuite $suite Test suite object.
*
* @return void
*/
public function endTestSuite( PHPUnit_Framework_TestSuite $suite ) {
$this->end_test_suite( $suite );
Expand All @@ -118,6 +134,8 @@ public function endTestSuite( PHPUnit_Framework_TestSuite $suite ) {
* A test started.
*
* @param PHPUnit_Framework_Test $test Test object.
*
* @return void
*/
public function startTest( PHPUnit_Framework_Test $test ) {
$this->start_test( $test );
Expand All @@ -128,6 +146,8 @@ public function startTest( PHPUnit_Framework_Test $test ) {
*
* @param PHPUnit_Framework_Test $test Test object.
* @param float $time Execution time of this test.
*
* @return void
*/
public function endTest( PHPUnit_Framework_Test $test, $time ) {
$this->end_test( $test, $time );
Expand Down
20 changes: 20 additions & 0 deletions src/TestListeners/TestListenerSnakeCaseMethods.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ trait TestListenerSnakeCaseMethods {
* @param Test $test Test object.
* @param Exception|Throwable $e Instance of the error encountered.
* @param float $time Execution time of this test.
*
* @return void
*/
public function add_error( $test, $e, $time ) {}

Expand All @@ -31,6 +33,8 @@ public function add_error( $test, $e, $time ) {}
* @param Test $test Test object.
* @param Warning $e Instance of the warning encountered.
* @param float $time Execution time of this test.
*
* @return void
*/
public function add_warning( $test, $e, $time ) {}

Expand All @@ -40,6 +44,8 @@ public function add_warning( $test, $e, $time ) {}
* @param Test $test Test object.
* @param AssertionFailedError $e Instance of the assertion failure exception encountered.
* @param float $time Execution time of this test.
*
* @return void
*/
public function add_failure( $test, $e, $time ) {}

Expand All @@ -49,6 +55,8 @@ public function add_failure( $test, $e, $time ) {}
* @param Test $test Test object.
* @param Exception|Throwable $e Instance of the incomplete test exception.
* @param float $time Execution time of this test.
*
* @return void
*/
public function add_incomplete_test( $test, $e, $time ) {}

Expand All @@ -58,6 +66,8 @@ public function add_incomplete_test( $test, $e, $time ) {}
* @param Test $test Test object.
* @param Exception|Throwable $e Instance of the risky test exception.
* @param float $time Execution time of this test.
*
* @return void
*/
public function add_risky_test( $test, $e, $time ) {}

Expand All @@ -67,27 +77,35 @@ public function add_risky_test( $test, $e, $time ) {}
* @param Test $test Test object.
* @param Exception|Throwable $e Instance of the skipped test exception.
* @param float $time Execution time of this test.
*
* @return void
*/
public function add_skipped_test( $test, $e, $time ) {}

/**
* A test suite started.
*
* @param TestSuite $suite Test suite object.
*
* @return void
*/
public function start_test_suite( $suite ) {}

/**
* A test suite ended.
*
* @param TestSuite $suite Test suite object.
*
* @return void
*/
public function end_test_suite( $suite ) {}

/**
* A test started.
*
* @param Test $test Test object.
*
* @return void
*/
public function start_test( $test ) {}

Expand All @@ -96,6 +114,8 @@ public function start_test( $test ) {}
*
* @param Test $test Test object.
* @param float $time Execution time of this test.
*
* @return void
*/
public function end_test( $test, $time ) {}
}
2 changes: 2 additions & 0 deletions tests/Polyfills/AssertClosedResourceShmopTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ final class AssertClosedResourceShmopTest extends AssertClosedResourceTestCase {
* while we need two.}
*
* @before
*
* @return void
*/
protected function skipOnIncompatiblePHP() {
if ( \PHP_VERSION_ID < 70000 || \PHP_VERSION_ID >= 80000 ) {
Expand Down
Loading

0 comments on commit c6ae986

Please sign in to comment.