From ba8a5644369b97ccf1551b28cbb8ed44977008d4 Mon Sep 17 00:00:00 2001 From: jrfnl Date: Mon, 6 Jan 2025 01:55:42 +0100 Subject: [PATCH] CS/QA: always have a `@since` tag ... at the "class" level for all classes in the `src` directory. --- phpunitpolyfills-autoload.php | 4 ++++ src/Exceptions/InvalidComparisonMethodException.php | 2 ++ src/Helpers/ResourceHelper.php | 2 ++ src/Polyfills/AssertClosedResource.php | 2 ++ src/Polyfills/AssertClosedResource_Empty.php | 2 ++ src/Polyfills/AssertEqualsSpecializations.php | 2 ++ src/Polyfills/AssertEqualsSpecializations_Empty.php | 2 ++ src/Polyfills/AssertFileDirectory.php | 2 ++ src/Polyfills/AssertFileDirectory_Empty.php | 2 ++ src/Polyfills/AssertFileEqualsSpecializations.php | 2 ++ src/Polyfills/AssertFileEqualsSpecializations_Empty.php | 2 ++ src/Polyfills/AssertIsType.php | 2 ++ src/Polyfills/AssertIsType_Empty.php | 2 ++ src/Polyfills/AssertNumericType.php | 2 ++ src/Polyfills/AssertNumericType_Empty.php | 2 ++ src/Polyfills/AssertObjectEquals.php | 2 ++ src/Polyfills/AssertObjectEquals_Empty.php | 2 ++ src/Polyfills/AssertStringContains.php | 2 ++ src/Polyfills/AssertStringContains_Empty.php | 2 ++ src/Polyfills/AssertionRenames.php | 2 ++ src/Polyfills/AssertionRenames_Empty.php | 2 ++ src/Polyfills/EqualToSpecializations.php | 2 ++ src/Polyfills/EqualToSpecializations_Empty.php | 2 ++ src/Polyfills/ExpectException.php | 2 ++ src/Polyfills/ExpectExceptionMessageMatches.php | 2 ++ src/Polyfills/ExpectExceptionMessageMatches_Empty.php | 2 ++ src/Polyfills/ExpectExceptionObject.php | 2 ++ src/Polyfills/ExpectExceptionObject_Empty.php | 2 ++ src/Polyfills/ExpectException_Empty.php | 2 ++ src/Polyfills/ExpectPHPException.php | 2 ++ src/Polyfills/ExpectPHPException_Empty.php | 2 ++ src/TestCases/TestCasePHPUnitGte8.php | 6 ++++++ src/TestCases/TestCasePHPUnitLte7.php | 6 ++++++ src/TestCases/XTestCase.php | 2 ++ .../TestListenerDefaultImplementationPHPUnit6.php | 2 ++ .../TestListenerDefaultImplementationPHPUnitGte7.php | 2 ++ .../TestListenerDefaultImplementationPHPUnitLte5.php | 2 ++ src/TestListeners/TestListenerSnakeCaseMethods.php | 2 ++ 38 files changed, 86 insertions(+) diff --git a/phpunitpolyfills-autoload.php b/phpunitpolyfills-autoload.php index 464e82a..c8ba1cf 100644 --- a/phpunitpolyfills-autoload.php +++ b/phpunitpolyfills-autoload.php @@ -9,12 +9,16 @@ /** * Custom autoloader. + * + * @since 0.1.0 */ final class Autoload { /** * Version number. * + * @since 1.0.1 + * * @var string */ const VERSION = '1.1.2'; diff --git a/src/Exceptions/InvalidComparisonMethodException.php b/src/Exceptions/InvalidComparisonMethodException.php index db05e34..e9f743e 100644 --- a/src/Exceptions/InvalidComparisonMethodException.php +++ b/src/Exceptions/InvalidComparisonMethodException.php @@ -9,6 +9,8 @@ * * PHPUnit natively throws a range of different exceptions. * The polyfill throws just one exception type with different messages. + * + * @since 1.0.0 */ final class InvalidComparisonMethodException extends Exception { diff --git a/src/Helpers/ResourceHelper.php b/src/Helpers/ResourceHelper.php index 15769fc..020fc51 100644 --- a/src/Helpers/ResourceHelper.php +++ b/src/Helpers/ResourceHelper.php @@ -16,6 +16,8 @@ * --------------------------------------------------------------------------------------------- * * @internal + * + * @since 1.0.0 */ final class ResourceHelper { diff --git a/src/Polyfills/AssertClosedResource.php b/src/Polyfills/AssertClosedResource.php index 62f847b..c63aae7 100644 --- a/src/Polyfills/AssertClosedResource.php +++ b/src/Polyfills/AssertClosedResource.php @@ -14,6 +14,8 @@ * * @link https://github.com/sebastianbergmann/phpunit/issues/4276 * @link https://github.com/sebastianbergmann/phpunit/pull/4365 + * + * @since 1.0.0 */ trait AssertClosedResource { diff --git a/src/Polyfills/AssertClosedResource_Empty.php b/src/Polyfills/AssertClosedResource_Empty.php index 8cb4c55..863963c 100644 --- a/src/Polyfills/AssertClosedResource_Empty.php +++ b/src/Polyfills/AssertClosedResource_Empty.php @@ -10,6 +10,8 @@ * For consistency, the "should this test be skipped" method is included * as the PHPUnit native versions of the `assertIs[Not]ClosedResource()` * assertions are affected by the same bugs. + * + * @since 1.0.0 */ trait AssertClosedResource { diff --git a/src/Polyfills/AssertEqualsSpecializations.php b/src/Polyfills/AssertEqualsSpecializations.php index d3a66dd..e25e039 100644 --- a/src/Polyfills/AssertEqualsSpecializations.php +++ b/src/Polyfills/AssertEqualsSpecializations.php @@ -12,6 +12,8 @@ * deprecated in PHPUnit 7.5.0 and removed in PHPUnit 9.0.0. * * @link https://github.com/sebastianbergmann/phpunit/issues/3340 + * + * @since 0.1.0 */ trait AssertEqualsSpecializations { diff --git a/src/Polyfills/AssertEqualsSpecializations_Empty.php b/src/Polyfills/AssertEqualsSpecializations_Empty.php index b8fbaa6..ef848bb 100644 --- a/src/Polyfills/AssertEqualsSpecializations_Empty.php +++ b/src/Polyfills/AssertEqualsSpecializations_Empty.php @@ -4,5 +4,7 @@ /** * Empty trait for use with PHPUnit >= 7.5.0 in which this polyfill is not needed. + * + * @since 0.1.0 */ trait AssertEqualsSpecializations {} diff --git a/src/Polyfills/AssertFileDirectory.php b/src/Polyfills/AssertFileDirectory.php index e3521a2..153fecc 100644 --- a/src/Polyfills/AssertFileDirectory.php +++ b/src/Polyfills/AssertFileDirectory.php @@ -15,6 +15,8 @@ * Introduced in PHPUnit 5.6.0. * * @link https://github.com/sebastianbergmann/phpunit/pull/2262 + * + * @since 0.2.0 */ trait AssertFileDirectory { diff --git a/src/Polyfills/AssertFileDirectory_Empty.php b/src/Polyfills/AssertFileDirectory_Empty.php index 127f5d4..04d2d1f 100644 --- a/src/Polyfills/AssertFileDirectory_Empty.php +++ b/src/Polyfills/AssertFileDirectory_Empty.php @@ -4,5 +4,7 @@ /** * Empty trait for use with PHPUnit >= 5.6.0 in which this polyfill is not needed. + * + * @since 0.2.0 */ trait AssertFileDirectory {} diff --git a/src/Polyfills/AssertFileEqualsSpecializations.php b/src/Polyfills/AssertFileEqualsSpecializations.php index 744ebc9..eeeaae3 100644 --- a/src/Polyfills/AssertFileEqualsSpecializations.php +++ b/src/Polyfills/AssertFileEqualsSpecializations.php @@ -15,6 +15,8 @@ * * @link https://github.com/sebastianbergmann/phpunit/issues/3949 * @link https://github.com/sebastianbergmann/phpunit/issues/3951 + * + * @since 0.1.0 */ trait AssertFileEqualsSpecializations { diff --git a/src/Polyfills/AssertFileEqualsSpecializations_Empty.php b/src/Polyfills/AssertFileEqualsSpecializations_Empty.php index 18009a8..56adb71 100644 --- a/src/Polyfills/AssertFileEqualsSpecializations_Empty.php +++ b/src/Polyfills/AssertFileEqualsSpecializations_Empty.php @@ -4,5 +4,7 @@ /** * Empty trait for use with PHPUnit >= 8.5.0 in which this polyfill is not needed. + * + * @since 0.1.0 */ trait AssertFileEqualsSpecializations {} diff --git a/src/Polyfills/AssertIsType.php b/src/Polyfills/AssertIsType.php index 2d42f01..6ca5430 100644 --- a/src/Polyfills/AssertIsType.php +++ b/src/Polyfills/AssertIsType.php @@ -14,6 +14,8 @@ * * @link https://github.com/sebastianbergmann/phpunit/issues/3368 * @link https://github.com/sebastianbergmann/phpunit/issues/3369 + * + * @since 0.1.0 */ trait AssertIsType { diff --git a/src/Polyfills/AssertIsType_Empty.php b/src/Polyfills/AssertIsType_Empty.php index e89add2..14b7bfd 100644 --- a/src/Polyfills/AssertIsType_Empty.php +++ b/src/Polyfills/AssertIsType_Empty.php @@ -4,5 +4,7 @@ /** * Empty trait for use with PHPUnit >= 7.5.0 in which this polyfill is not needed. + * + * @since 0.1.0 */ trait AssertIsType {} diff --git a/src/Polyfills/AssertNumericType.php b/src/Polyfills/AssertNumericType.php index 3fdc52d..2179457 100644 --- a/src/Polyfills/AssertNumericType.php +++ b/src/Polyfills/AssertNumericType.php @@ -8,6 +8,8 @@ * Introduced in PHPUnit 5.0.0. * * @link https://github.com/sebastianbergmann/phpunit/pull/1753 + * + * @since 0.2.0 */ trait AssertNumericType { diff --git a/src/Polyfills/AssertNumericType_Empty.php b/src/Polyfills/AssertNumericType_Empty.php index 6e147e5..71de2b8 100644 --- a/src/Polyfills/AssertNumericType_Empty.php +++ b/src/Polyfills/AssertNumericType_Empty.php @@ -4,5 +4,7 @@ /** * Empty trait for use with PHPUnit >= 5.0.0 in which this polyfill is not needed. + * + * @since 0.2.0 */ trait AssertNumericType {} diff --git a/src/Polyfills/AssertObjectEquals.php b/src/Polyfills/AssertObjectEquals.php index f282a7f..e4dbbf1 100644 --- a/src/Polyfills/AssertObjectEquals.php +++ b/src/Polyfills/AssertObjectEquals.php @@ -22,6 +22,8 @@ * @link https://github.com/sebastianbergmann/phpunit/issues/4707 * @link https://github.com/sebastianbergmann/phpunit/commit/1dba8c3a4b2dd04a3ff1869f75daaeb6757a14ee * @link https://github.com/sebastianbergmann/phpunit/commit/6099c5eefccfda860c889f575d58b5fe6cc10c83 + * + * @since 1.0.0 */ trait AssertObjectEquals { diff --git a/src/Polyfills/AssertObjectEquals_Empty.php b/src/Polyfills/AssertObjectEquals_Empty.php index 4390a97..9546154 100644 --- a/src/Polyfills/AssertObjectEquals_Empty.php +++ b/src/Polyfills/AssertObjectEquals_Empty.php @@ -4,5 +4,7 @@ /** * Empty trait for use with PHPUnit >= 9.4.0 in which this polyfill is not needed. + * + * @since 1.0.0 */ trait AssertObjectEquals {} diff --git a/src/Polyfills/AssertStringContains.php b/src/Polyfills/AssertStringContains.php index 1e6ec81..711b78e 100644 --- a/src/Polyfills/AssertStringContains.php +++ b/src/Polyfills/AssertStringContains.php @@ -19,6 +19,8 @@ * @link https://github.com/sebastianbergmann/phpunit/issues/3422 * @link https://github.com/sebastianbergmann/phpunit/issues/2520 * @link https://github.com/sebastianbergmann/phpunit/pull/2778 + * + * @since 0.1.0 */ trait AssertStringContains { diff --git a/src/Polyfills/AssertStringContains_Empty.php b/src/Polyfills/AssertStringContains_Empty.php index 6d82e87..1002b00 100644 --- a/src/Polyfills/AssertStringContains_Empty.php +++ b/src/Polyfills/AssertStringContains_Empty.php @@ -4,5 +4,7 @@ /** * Empty trait for use with PHPUnit >= 7.5.0 in which this polyfill is not needed. + * + * @since 0.1.0 */ trait AssertStringContains {} diff --git a/src/Polyfills/AssertionRenames.php b/src/Polyfills/AssertionRenames.php index f199d58..2ed936d 100644 --- a/src/Polyfills/AssertionRenames.php +++ b/src/Polyfills/AssertionRenames.php @@ -38,6 +38,8 @@ * @link https://github.com/sebastianbergmann/phpunit/issues/4088 * @link https://github.com/sebastianbergmann/phpunit/issues/4089 * @link https://github.com/sebastianbergmann/phpunit/issues/4090 + * + * @since 0.1.0 */ trait AssertionRenames { diff --git a/src/Polyfills/AssertionRenames_Empty.php b/src/Polyfills/AssertionRenames_Empty.php index 4de7858..250aa5d 100644 --- a/src/Polyfills/AssertionRenames_Empty.php +++ b/src/Polyfills/AssertionRenames_Empty.php @@ -4,5 +4,7 @@ /** * Empty trait for use with PHPUnit >= 9.1.0 in which this polyfill is not needed. + * + * @since 0.1.0 */ trait AssertionRenames {} diff --git a/src/Polyfills/EqualToSpecializations.php b/src/Polyfills/EqualToSpecializations.php index a8eefae..5cc0461 100644 --- a/src/Polyfills/EqualToSpecializations.php +++ b/src/Polyfills/EqualToSpecializations.php @@ -15,6 +15,8 @@ * never deprecated but leads to unexpected behaviour as they are ignored in PHPUnit 9.0.0. * * @link https://github.com/sebastianbergmann/phpunit/commit/43c01a4e0c74a4bf019a8d879bced5146af2fbb6 + * + * @since 1.0.0 */ trait EqualToSpecializations { diff --git a/src/Polyfills/EqualToSpecializations_Empty.php b/src/Polyfills/EqualToSpecializations_Empty.php index a03eb52..6275d07 100644 --- a/src/Polyfills/EqualToSpecializations_Empty.php +++ b/src/Polyfills/EqualToSpecializations_Empty.php @@ -4,5 +4,7 @@ /** * Empty trait for use with PHPUnit >= 9.0.0 in which this polyfill is not needed. + * + * @since 1.0.0 */ trait EqualToSpecializations {} diff --git a/src/Polyfills/ExpectException.php b/src/Polyfills/ExpectException.php index 07240fb..6d65273 100644 --- a/src/Polyfills/ExpectException.php +++ b/src/Polyfills/ExpectException.php @@ -20,6 +20,8 @@ * * @link https://github.com/sebastianbergmann/phpunit/commit/55d97d56696d5f6dee02732c08212ec519057803 * @link https://github.com/sebastianbergmann/phpunit/commit/13305a6183ede02fc5d2f3534a93efac852813d5 + * + * @since 0.2.0 */ trait ExpectException { diff --git a/src/Polyfills/ExpectExceptionMessageMatches.php b/src/Polyfills/ExpectExceptionMessageMatches.php index 0a46c54..14ced1b 100644 --- a/src/Polyfills/ExpectExceptionMessageMatches.php +++ b/src/Polyfills/ExpectExceptionMessageMatches.php @@ -13,6 +13,8 @@ * @link https://github.com/sebastianbergmann/phpunit/commit/d1199cb2e43a934b51521656be9748f63febe18e * @link https://github.com/sebastianbergmann/phpunit/issues/4133 * @link https://github.com/sebastianbergmann/phpunit/issues/3957 + * + * @since 0.1.0 */ trait ExpectExceptionMessageMatches { diff --git a/src/Polyfills/ExpectExceptionMessageMatches_Empty.php b/src/Polyfills/ExpectExceptionMessageMatches_Empty.php index f6278c1..7ddc36f 100644 --- a/src/Polyfills/ExpectExceptionMessageMatches_Empty.php +++ b/src/Polyfills/ExpectExceptionMessageMatches_Empty.php @@ -4,5 +4,7 @@ /** * Empty trait for use with PHPUnit >= 8.4.0 in which this polyfill is not needed. + * + * @since 0.1.0 */ trait ExpectExceptionMessageMatches {} diff --git a/src/Polyfills/ExpectExceptionObject.php b/src/Polyfills/ExpectExceptionObject.php index 65e3408..9cabbd9 100644 --- a/src/Polyfills/ExpectExceptionObject.php +++ b/src/Polyfills/ExpectExceptionObject.php @@ -10,6 +10,8 @@ * Introduced in PHPUnit 6.4.0. * * @link https://github.com/sebastianbergmann/phpunit/pull/2780 + * + * @since 0.1.0 */ trait ExpectExceptionObject { diff --git a/src/Polyfills/ExpectExceptionObject_Empty.php b/src/Polyfills/ExpectExceptionObject_Empty.php index 499bee2..1967526 100644 --- a/src/Polyfills/ExpectExceptionObject_Empty.php +++ b/src/Polyfills/ExpectExceptionObject_Empty.php @@ -4,5 +4,7 @@ /** * Empty trait for use with PHPUnit >= 6.4.0 in which this polyfill is not needed. + * + * @since 0.1.0 */ trait ExpectExceptionObject {} diff --git a/src/Polyfills/ExpectException_Empty.php b/src/Polyfills/ExpectException_Empty.php index 2a67f6d..09aa607 100644 --- a/src/Polyfills/ExpectException_Empty.php +++ b/src/Polyfills/ExpectException_Empty.php @@ -4,5 +4,7 @@ /** * Empty trait for use with PHPUnit >= 5.2.0 in which this polyfill is not needed. + * + * @since 0.2.0 */ trait ExpectException {} diff --git a/src/Polyfills/ExpectPHPException.php b/src/Polyfills/ExpectPHPException.php index a264010..d435973 100644 --- a/src/Polyfills/ExpectPHPException.php +++ b/src/Polyfills/ExpectPHPException.php @@ -14,6 +14,8 @@ * @link https://github.com/sebastianbergmann/phpunit/issues/3775 * @link https://github.com/sebastianbergmann/phpunit/issues/3776 * @link https://github.com/sebastianbergmann/phpunit/issues/3777 + * + * @since 0.1.0 */ trait ExpectPHPException { diff --git a/src/Polyfills/ExpectPHPException_Empty.php b/src/Polyfills/ExpectPHPException_Empty.php index 4d787b2..c70e9d0 100644 --- a/src/Polyfills/ExpectPHPException_Empty.php +++ b/src/Polyfills/ExpectPHPException_Empty.php @@ -4,5 +4,7 @@ /** * Empty trait for use with PHPUnit >= 8.4.0 in which this polyfill is not needed. + * + * @since 0.1.0 */ trait ExpectPHPException {} diff --git a/src/TestCases/TestCasePHPUnitGte8.php b/src/TestCases/TestCasePHPUnitGte8.php index 4a54cf5..1eef591 100644 --- a/src/TestCases/TestCasePHPUnitGte8.php +++ b/src/TestCases/TestCasePHPUnitGte8.php @@ -21,6 +21,8 @@ * methods to get round the signature change in PHPUnit 8. * * When using this TestCase, the snakecase method names need to be used to overload a fixture method. + * + * @since 0.1.0 */ abstract class TestCase extends PHPUnit_TestCase { @@ -63,6 +65,8 @@ protected function setUp(): void { * * This method is called before the execution of a test starts and after setUp() is called. * + * @since 0.2.0 + * * @return void */ protected function assertPreConditions(): void { @@ -75,6 +79,8 @@ protected function assertPreConditions(): void { * * This method is called before the execution of a test ends and before tearDown() is called. * + * @since 0.2.0 + * * @return void */ protected function assertPostConditions(): void { diff --git a/src/TestCases/TestCasePHPUnitLte7.php b/src/TestCases/TestCasePHPUnitLte7.php index 1cdfd8c..bb7f065 100644 --- a/src/TestCases/TestCasePHPUnitLte7.php +++ b/src/TestCases/TestCasePHPUnitLte7.php @@ -28,6 +28,8 @@ * methods to get round the signature change in PHPUnit 8. * * When using this TestCase, the snakecase method names need to be used to overload a fixture method. + * + * @since 0.1.0 */ abstract class TestCase extends PHPUnit_TestCase { @@ -77,6 +79,8 @@ protected function setUp() { * * This method is called before the execution of a test starts and after setUp() is called. * + * @since 0.2.0 + * * @return void */ protected function assertPreConditions() { @@ -89,6 +93,8 @@ protected function assertPreConditions() { * * This method is called before the execution of a test ends and before tearDown() is called. * + * @since 0.2.0 + * * @return void */ protected function assertPostConditions() { diff --git a/src/TestCases/XTestCase.php b/src/TestCases/XTestCase.php index c8dd875..234ec47 100644 --- a/src/TestCases/XTestCase.php +++ b/src/TestCases/XTestCase.php @@ -30,6 +30,8 @@ * `@after` and `@afterClass` annotations. * The naming of the overloaded methods is open as long as the method names don't conflict with * the PHPUnit native method names. + * + * @since 0.1.0 */ abstract class XTestCase extends PHPUnit_TestCase { diff --git a/src/TestListeners/TestListenerDefaultImplementationPHPUnit6.php b/src/TestListeners/TestListenerDefaultImplementationPHPUnit6.php index 93e1d97..d6bca59 100644 --- a/src/TestListeners/TestListenerDefaultImplementationPHPUnit6.php +++ b/src/TestListeners/TestListenerDefaultImplementationPHPUnit6.php @@ -16,6 +16,8 @@ * * When using this TestListener trait, the snake_case method names need to be used to implement * the listener functionality. + * + * @since 0.2.0 */ trait TestListenerDefaultImplementation { diff --git a/src/TestListeners/TestListenerDefaultImplementationPHPUnitGte7.php b/src/TestListeners/TestListenerDefaultImplementationPHPUnitGte7.php index ed6d61c..1a17523 100644 --- a/src/TestListeners/TestListenerDefaultImplementationPHPUnitGte7.php +++ b/src/TestListeners/TestListenerDefaultImplementationPHPUnitGte7.php @@ -16,6 +16,8 @@ * * When using this TestListener trait, the snake_case method names need to be used to implement * the listener functionality. + * + * @since 0.2.0 */ trait TestListenerDefaultImplementation { diff --git a/src/TestListeners/TestListenerDefaultImplementationPHPUnitLte5.php b/src/TestListeners/TestListenerDefaultImplementationPHPUnitLte5.php index 631e2b1..c376099 100644 --- a/src/TestListeners/TestListenerDefaultImplementationPHPUnitLte5.php +++ b/src/TestListeners/TestListenerDefaultImplementationPHPUnitLte5.php @@ -22,6 +22,8 @@ * file are based on the namespaced names. As both the namespaced names as well as the * non-namespaced names exist in PHPUnit 4.8.36+/5.7.21+, we cannot create class aliases to * get round the signature mismatch and need this trait using the old names instead.} + * + * @since 0.2.0 */ trait TestListenerDefaultImplementation { diff --git a/src/TestListeners/TestListenerSnakeCaseMethods.php b/src/TestListeners/TestListenerSnakeCaseMethods.php index 4d6a08f..1072f48 100644 --- a/src/TestListeners/TestListenerSnakeCaseMethods.php +++ b/src/TestListeners/TestListenerSnakeCaseMethods.php @@ -12,6 +12,8 @@ /** * Renamed snake_case TestListener method collection used by the TestListenerDefaultImplementation traits. * + * @since 0.2.0 + * * @phpcs:disable VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable -- This is intentional as these are template methods. */ trait TestListenerSnakeCaseMethods {