diff --git a/src/Polyfills/ExpectException.php b/src/Polyfills/ExpectException.php index 6ec0e7b..07240fb 100644 --- a/src/Polyfills/ExpectException.php +++ b/src/Polyfills/ExpectException.php @@ -45,6 +45,8 @@ trait ExpectException { * Clear any stored exception information between each test. * * @after + * + * @return void */ public function clearExceptionInfo() { $this->exceptionMessage = ''; diff --git a/src/TestListeners/TestListenerDefaultImplementationPHPUnit6.php b/src/TestListeners/TestListenerDefaultImplementationPHPUnit6.php index 01cec17..93e1d97 100644 --- a/src/TestListeners/TestListenerDefaultImplementationPHPUnit6.php +++ b/src/TestListeners/TestListenerDefaultImplementationPHPUnit6.php @@ -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 ); @@ -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 ); @@ -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 ); @@ -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 ); @@ -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 ); @@ -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 ); @@ -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 ); @@ -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 ); @@ -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 ); @@ -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 ); diff --git a/src/TestListeners/TestListenerDefaultImplementationPHPUnitGte7.php b/src/TestListeners/TestListenerDefaultImplementationPHPUnitGte7.php index 71733a5..ed6d61c 100644 --- a/src/TestListeners/TestListenerDefaultImplementationPHPUnitGte7.php +++ b/src/TestListeners/TestListenerDefaultImplementationPHPUnitGte7.php @@ -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 ); @@ -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 ); @@ -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 ); @@ -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 ); @@ -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 ); @@ -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 ); @@ -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 ); @@ -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 ); @@ -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 ); @@ -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 ); diff --git a/src/TestListeners/TestListenerDefaultImplementationPHPUnitLte5.php b/src/TestListeners/TestListenerDefaultImplementationPHPUnitLte5.php index 810ae4b..631e2b1 100644 --- a/src/TestListeners/TestListenerDefaultImplementationPHPUnitLte5.php +++ b/src/TestListeners/TestListenerDefaultImplementationPHPUnitLte5.php @@ -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 ); @@ -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 ); @@ -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 ); @@ -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 ); @@ -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 ); @@ -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 ); @@ -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 ); @@ -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 ); @@ -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 ); @@ -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 ); diff --git a/src/TestListeners/TestListenerSnakeCaseMethods.php b/src/TestListeners/TestListenerSnakeCaseMethods.php index e21ef4a..8985de6 100644 --- a/src/TestListeners/TestListenerSnakeCaseMethods.php +++ b/src/TestListeners/TestListenerSnakeCaseMethods.php @@ -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 ) {} @@ -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 ) {} @@ -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 ) {} @@ -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 ) {} @@ -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 ) {} @@ -67,6 +77,8 @@ 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 ) {} @@ -74,6 +86,8 @@ 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 ) {} @@ -81,6 +95,8 @@ public function start_test_suite( $suite ) {} * A test suite ended. * * @param TestSuite $suite Test suite object. + * + * @return void */ public function end_test_suite( $suite ) {} @@ -88,6 +104,8 @@ public function end_test_suite( $suite ) {} * A test started. * * @param Test $test Test object. + * + * @return void */ public function start_test( $test ) {} @@ -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 ) {} } diff --git a/tests/Polyfills/AssertClosedResourceShmopTest.php b/tests/Polyfills/AssertClosedResourceShmopTest.php index fc28bed..d4bb37f 100644 --- a/tests/Polyfills/AssertClosedResourceShmopTest.php +++ b/tests/Polyfills/AssertClosedResourceShmopTest.php @@ -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 ) { diff --git a/tests/Polyfills/AssertFileDirectoryTest.php b/tests/Polyfills/AssertFileDirectoryTest.php index 8b52737..59d4ed6 100644 --- a/tests/Polyfills/AssertFileDirectoryTest.php +++ b/tests/Polyfills/AssertFileDirectoryTest.php @@ -40,6 +40,8 @@ public function testAssertIsReadable() { * * This exception was thrown until PHP 7.0.0. Since PHP 7.0.0, a PHP native TypeError will * be thrown based on the type declaration. + * + * @return void */ public function testAssertIsReadableException() { try { @@ -100,6 +102,8 @@ public function testAssertNotIsReadable() { * be thrown based on the type declaration. * * @requires PHPUnit < 10.0.0 + * + * @return void */ public function testAssertNotIsReadableException() { try { @@ -158,6 +162,8 @@ public function testAssertIsWritable() { * * This exception was thrown until PHP 7.0.0. Since PHP 7.0.0, a PHP native TypeError will * be thrown based on the type declaration. + * + * @return void */ public function testAssertIsWritableException() { try { @@ -218,6 +224,8 @@ public function testAssertNotIsWritable() { * be thrown based on the type declaration. * * @requires PHPUnit < 10.0.0 + * + * @return void */ public function testAssertNotIsWritableException() { try { @@ -276,6 +284,8 @@ public function testAssertDirectoryExists() { * * This exception was thrown until PHP 7.0.0. Since PHP 7.0.0, a PHP native TypeError will * be thrown based on the type declaration. + * + * @return void */ public function testAssertDirectoryExistsException() { try { @@ -336,6 +346,8 @@ public function testAssertDirectoryNotExists() { * be thrown based on the type declaration. * * @requires PHPUnit < 10.0.0 + * + * @return void */ public function testAssertDirectoryNotExistsException() { try { diff --git a/tests/Polyfills/ExpectExceptionTest.php b/tests/Polyfills/ExpectExceptionTest.php index ac2bf38..79b3dec 100644 --- a/tests/Polyfills/ExpectExceptionTest.php +++ b/tests/Polyfills/ExpectExceptionTest.php @@ -59,6 +59,8 @@ public function testExpectExceptionCode() { * this method as it needs union types. * * @requires PHPUnit < 7 + * + * @return void */ public function testExpectExceptionCodeException() { $test = new InvalidExceptionCodeTestCase( 'test' ); diff --git a/tests/TestListeners/Fixtures/TestListenerImplementation.php b/tests/TestListeners/Fixtures/TestListenerImplementation.php index 1980126..6e34266 100644 --- a/tests/TestListeners/Fixtures/TestListenerImplementation.php +++ b/tests/TestListeners/Fixtures/TestListenerImplementation.php @@ -75,6 +75,8 @@ class TestListenerImplementation implements TestListener { * @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 ) { ++$this->errorCount; @@ -86,6 +88,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 ) { ++$this->warningCount; @@ -97,6 +101,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 ) { ++$this->failureCount; @@ -108,6 +114,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 ) { ++$this->incompleteCount; @@ -119,6 +127,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 ) { ++$this->riskyCount; @@ -130,6 +140,8 @@ 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 ) { ++$this->skippedCount; @@ -139,6 +151,8 @@ public function add_skipped_test( $test, $e, $time ) { * A test started. * * @param Test $test Test object. + * + * @return void */ public function start_test( $test ) { ++$this->startTestCount; @@ -149,6 +163,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 ) { ++$this->endTestCount;