| Q | A
| --------------------| ---------------
| PHPUnit version | 8.1
| PHP version | 7.2
| Installation Method | Composer
By releasing the 8.1 version of PHPUnit some breaking changes occured. I guess it's due to added strict_types declaration to some interfaces. I know that there was an issue #3236 but still it seems to be undocumented BC... 馃槩
Please provide specific information about the breaking change(s).
@sebastianbergmann for example here:
The boolean type hint was added (https://github.com/sebastianbergmann/phpunit/commit/8e98e32d067024632060783146bde5f505fd197c#diff-dc7f229adf1ae8ebc0e0a9a4166eb711).
What part of
> This class is not covered by the backward compatibility promise for PHPUnit
is not clear?
Let me rephrase that: the class in question is (currently) not covered by the backward compatibility promise for PHPUnit.
I still think that it is an internal implementation detail and therefore should not be subject to the backward compatibility promise. If you can show me a valid use case that does not work with PHPUnit 8.1 but did work with PHPUnit 8 then we can discuss whether or not this class should be covered by the BC promise.
Of course, I get it. Still I'm thinking it should be at least mentioned somewhere in release notes to keep it in sight...
Better way (IMHO) would be deprecate the using of those objects in the version 8 and later (in version 9?) make them incompatible...
I do not think that changes to implementation details should be covered in release notes.
@sebastianbergmann it's used by php-mock library: https://github.com/php-mock/php-mock-phpunit/blob/master/classes/DefaultArgumentRemover.php (for example)
Another example is here: https://github.com/sebastianbergmann/phpunit/commit/60db5344ebfeea2212d58273c92dc63a5488e320#r33047915
I do not know what you (or the author(s) of php-mock) expect me to do here: this is the kind of problem you create for yourself when you decide to rely on implementation details of third-party software.
@sebastianbergmann okay, no problem. So the MockObject interface (https://github.com/sebastianbergmann/phpunit/blob/8.1.0/src/Framework/MockObject/MockObject.php) should be considered as internal too? Because BC was made by removing the @method annotation from the class too.
Can you explain how the removal of a @method annotation breaks compatibility?
@sebastianbergmann it's already mentioned by @possi here: https://github.com/sebastianbergmann/phpunit/commit/60db5344ebfeea2212d58273c92dc63a5488e320#r33047915
I guess the tools for static analysis used that somehow? :)
I brought the @method annotation back in 31df2e805fe0cf184bdfcb528a696dc1daae40c3.
Is 31df2e8 also targeting a stable release? (Not familiar with PHPUnit's branching model)
31df2e805fe0cf184bdfcb528a696dc1daae40c3 will be part of PHPUnit 8.1.1, the first bugfix release for PHPUnit 8.1.
Most helpful comment
I brought the
@methodannotation back in 31df2e805fe0cf184bdfcb528a696dc1daae40c3.