Skip to content

Commit

Permalink
Merge pull request #224 from Yoast/feature/consistently-use-since-tags
Browse files Browse the repository at this point in the history
CS/QA: always have a `@since` tag
  • Loading branch information
jrfnl authored Jan 6, 2025
2 parents dacfc81 + ba8a564 commit a5633bc
Show file tree
Hide file tree
Showing 38 changed files with 86 additions and 0 deletions.
4 changes: 4 additions & 0 deletions phpunitpolyfills-autoload.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
2 changes: 2 additions & 0 deletions src/Exceptions/InvalidComparisonMethodException.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down
2 changes: 2 additions & 0 deletions src/Helpers/ResourceHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
* ---------------------------------------------------------------------------------------------
*
* @internal
*
* @since 1.0.0
*/
final class ResourceHelper {

Expand Down
2 changes: 2 additions & 0 deletions src/Polyfills/AssertClosedResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down
2 changes: 2 additions & 0 deletions src/Polyfills/AssertClosedResource_Empty.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down
2 changes: 2 additions & 0 deletions src/Polyfills/AssertEqualsSpecializations.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down
2 changes: 2 additions & 0 deletions src/Polyfills/AssertEqualsSpecializations_Empty.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 {}
2 changes: 2 additions & 0 deletions src/Polyfills/AssertFileDirectory.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
* Introduced in PHPUnit 5.6.0.
*
* @link https://github.com/sebastianbergmann/phpunit/pull/2262
*
* @since 0.2.0
*/
trait AssertFileDirectory {

Expand Down
2 changes: 2 additions & 0 deletions src/Polyfills/AssertFileDirectory_Empty.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 {}
2 changes: 2 additions & 0 deletions src/Polyfills/AssertFileEqualsSpecializations.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down
2 changes: 2 additions & 0 deletions src/Polyfills/AssertFileEqualsSpecializations_Empty.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 {}
2 changes: 2 additions & 0 deletions src/Polyfills/AssertIsType.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down
2 changes: 2 additions & 0 deletions src/Polyfills/AssertIsType_Empty.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 {}
2 changes: 2 additions & 0 deletions src/Polyfills/AssertNumericType.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
* Introduced in PHPUnit 5.0.0.
*
* @link https://github.com/sebastianbergmann/phpunit/pull/1753
*
* @since 0.2.0
*/
trait AssertNumericType {

Expand Down
2 changes: 2 additions & 0 deletions src/Polyfills/AssertNumericType_Empty.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 {}
2 changes: 2 additions & 0 deletions src/Polyfills/AssertObjectEquals.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down
2 changes: 2 additions & 0 deletions src/Polyfills/AssertObjectEquals_Empty.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 {}
2 changes: 2 additions & 0 deletions src/Polyfills/AssertStringContains.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down
2 changes: 2 additions & 0 deletions src/Polyfills/AssertStringContains_Empty.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 {}
2 changes: 2 additions & 0 deletions src/Polyfills/AssertionRenames.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down
2 changes: 2 additions & 0 deletions src/Polyfills/AssertionRenames_Empty.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 {}
2 changes: 2 additions & 0 deletions src/Polyfills/EqualToSpecializations.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down
2 changes: 2 additions & 0 deletions src/Polyfills/EqualToSpecializations_Empty.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 {}
2 changes: 2 additions & 0 deletions src/Polyfills/ExpectException.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down
2 changes: 2 additions & 0 deletions src/Polyfills/ExpectExceptionMessageMatches.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down
2 changes: 2 additions & 0 deletions src/Polyfills/ExpectExceptionMessageMatches_Empty.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 {}
2 changes: 2 additions & 0 deletions src/Polyfills/ExpectExceptionObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
* Introduced in PHPUnit 6.4.0.
*
* @link https://github.com/sebastianbergmann/phpunit/pull/2780
*
* @since 0.1.0
*/
trait ExpectExceptionObject {

Expand Down
2 changes: 2 additions & 0 deletions src/Polyfills/ExpectExceptionObject_Empty.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 {}
2 changes: 2 additions & 0 deletions src/Polyfills/ExpectException_Empty.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 {}
2 changes: 2 additions & 0 deletions src/Polyfills/ExpectPHPException.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down
2 changes: 2 additions & 0 deletions src/Polyfills/ExpectPHPException_Empty.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 {}
6 changes: 6 additions & 0 deletions src/TestCases/TestCasePHPUnitGte8.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down Expand Up @@ -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 {
Expand All @@ -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 {
Expand Down
6 changes: 6 additions & 0 deletions src/TestCases/TestCasePHPUnitLte7.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down Expand Up @@ -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() {
Expand All @@ -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() {
Expand Down
2 changes: 2 additions & 0 deletions src/TestCases/XTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down
2 changes: 2 additions & 0 deletions src/TestListeners/TestListenerSnakeCaseMethods.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit a5633bc

Please sign in to comment.