Skip to content

Commit

Permalink
Closes #5690
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianbergmann committed Feb 2, 2024
1 parent ece3536 commit f6a1f7c
Show file tree
Hide file tree
Showing 55 changed files with 96 additions and 89 deletions.
7 changes: 7 additions & 0 deletions ChangeLog-11.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

All notable changes of the PHPUnit 11.0 release series are documented in this file using the [Keep a CHANGELOG](https://keepachangelog.com/) principles.

## [11.0.1] - 2024-02-02

### Fixed

* [#5690](https://github.com/sebastianbergmann/phpunit/issues/5690): Backward Compatibility break in `PHPUnit\Framework\Constraint\Constraint`

## [11.0.0] - 2024-02-02

### Added
Expand Down Expand Up @@ -74,4 +80,5 @@ All notable changes of the PHPUnit 11.0 release series are documented in this fi
* `PHPUnit\TextUI\Configuration\Configuration::registerMockObjectsFromTestArgumentsRecursively()`
* `PHPUnit\Framework\Constraint\Constraint::exporter()`

[11.0.1]: https://github.com/sebastianbergmann/phpunit/compare/11.0.0...11.0.1
[11.0.0]: https://github.com/sebastianbergmann/phpunit/compare/10.5...11.0.0
2 changes: 1 addition & 1 deletion src/Framework/Constraint/Boolean/IsFalse.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
/**
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*/
final readonly class IsFalse extends Constraint
final class IsFalse extends Constraint
{
/**
* Returns a string representation of the constraint.
Expand Down
2 changes: 1 addition & 1 deletion src/Framework/Constraint/Boolean/IsTrue.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
/**
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*/
final readonly class IsTrue extends Constraint
final class IsTrue extends Constraint
{
/**
* Returns a string representation of the constraint.
Expand Down
4 changes: 2 additions & 2 deletions src/Framework/Constraint/Callback.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*/
final readonly class Callback extends Constraint
final class Callback extends Constraint
{
/**
* @psalm-var callable(CallbackInput $input): bool
*/
private mixed $callback;
private readonly mixed $callback;

/**
* @psalm-param callable(CallbackInput $input): bool $callback
Expand Down
4 changes: 2 additions & 2 deletions src/Framework/Constraint/Cardinality/Count.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@
/**
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*/
readonly class Count extends Constraint
class Count extends Constraint
{
private int $expectedCount;
private readonly int $expectedCount;

public function __construct(int $expected)
{
Expand Down
4 changes: 2 additions & 2 deletions src/Framework/Constraint/Cardinality/GreaterThan.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
/**
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*/
final readonly class GreaterThan extends Constraint
final class GreaterThan extends Constraint
{
private mixed $value;
private readonly mixed $value;

public function __construct(mixed $value)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Framework/Constraint/Cardinality/IsEmpty.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
/**
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*/
final readonly class IsEmpty extends Constraint
final class IsEmpty extends Constraint
{
/**
* Returns a string representation of the constraint.
Expand Down
4 changes: 2 additions & 2 deletions src/Framework/Constraint/Cardinality/LessThan.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
/**
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*/
final readonly class LessThan extends Constraint
final class LessThan extends Constraint
{
private mixed $value;
private readonly mixed $value;

public function __construct(mixed $value)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Framework/Constraint/Cardinality/SameSize.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
/**
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*/
final readonly class SameSize extends Count
final class SameSize extends Count
{
/**
* @psalm-param Countable|iterable $expected
Expand Down
2 changes: 1 addition & 1 deletion src/Framework/Constraint/Constraint.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
/**
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*/
abstract readonly class Constraint implements Countable, SelfDescribing
abstract class Constraint implements Countable, SelfDescribing
{
/**
* Evaluates the constraint for parameter $other.
Expand Down
4 changes: 2 additions & 2 deletions src/Framework/Constraint/Equality/IsEqual.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
/**
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*/
final readonly class IsEqual extends Constraint
final class IsEqual extends Constraint
{
private mixed $value;
private readonly mixed $value;

public function __construct(mixed $value)
{
Expand Down
4 changes: 2 additions & 2 deletions src/Framework/Constraint/Equality/IsEqualCanonicalizing.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
/**
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*/
final readonly class IsEqualCanonicalizing extends Constraint
final class IsEqualCanonicalizing extends Constraint
{
private mixed $value;
private readonly mixed $value;

public function __construct(mixed $value)
{
Expand Down
4 changes: 2 additions & 2 deletions src/Framework/Constraint/Equality/IsEqualIgnoringCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
/**
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*/
final readonly class IsEqualIgnoringCase extends Constraint
final class IsEqualIgnoringCase extends Constraint
{
private mixed $value;
private readonly mixed $value;

public function __construct(mixed $value)
{
Expand Down
6 changes: 3 additions & 3 deletions src/Framework/Constraint/Equality/IsEqualWithDelta.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
/**
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*/
final readonly class IsEqualWithDelta extends Constraint
final class IsEqualWithDelta extends Constraint
{
private mixed $value;
private float $delta;
private readonly mixed $value;
private readonly float $delta;

public function __construct(mixed $value, float $delta)
{
Expand Down
4 changes: 2 additions & 2 deletions src/Framework/Constraint/Exception/Exception.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
/**
* @internal This class is not covered by the backward compatibility promise for PHPUnit
*/
final readonly class Exception extends Constraint
final class Exception extends Constraint
{
private string $className;
private readonly string $className;

public function __construct(string $className)
{
Expand Down
4 changes: 2 additions & 2 deletions src/Framework/Constraint/Exception/ExceptionCode.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
/**
* @internal This class is not covered by the backward compatibility promise for PHPUnit
*/
final readonly class ExceptionCode extends Constraint
final class ExceptionCode extends Constraint
{
private int|string $expectedCode;
private readonly int|string $expectedCode;

public function __construct(int|string $expected)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
/**
* @internal This class is not covered by the backward compatibility promise for PHPUnit
*/
final readonly class ExceptionMessageIsOrContains extends Constraint
final class ExceptionMessageIsOrContains extends Constraint
{
private string $expectedMessage;
private readonly string $expectedMessage;

public function __construct(string $expectedMessage)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
/**
* @internal This class is not covered by the backward compatibility promise for PHPUnit
*/
final readonly class ExceptionMessageMatchesRegularExpression extends Constraint
final class ExceptionMessageMatchesRegularExpression extends Constraint
{
private string $regularExpression;
private readonly string $regularExpression;

public function __construct(string $regularExpression)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Framework/Constraint/Filesystem/DirectoryExists.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
/**
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*/
final readonly class DirectoryExists extends Constraint
final class DirectoryExists extends Constraint
{
/**
* Returns a string representation of the constraint.
Expand Down
2 changes: 1 addition & 1 deletion src/Framework/Constraint/Filesystem/FileExists.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
/**
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*/
final readonly class FileExists extends Constraint
final class FileExists extends Constraint
{
/**
* Returns a string representation of the constraint.
Expand Down
2 changes: 1 addition & 1 deletion src/Framework/Constraint/Filesystem/IsReadable.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
/**
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*/
final readonly class IsReadable extends Constraint
final class IsReadable extends Constraint
{
/**
* Returns a string representation of the constraint.
Expand Down
2 changes: 1 addition & 1 deletion src/Framework/Constraint/Filesystem/IsWritable.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
/**
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*/
final readonly class IsWritable extends Constraint
final class IsWritable extends Constraint
{
/**
* Returns a string representation of the constraint.
Expand Down
2 changes: 1 addition & 1 deletion src/Framework/Constraint/IsAnything.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
/**
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*/
final readonly class IsAnything extends Constraint
final class IsAnything extends Constraint
{
/**
* Evaluates the constraint for parameter $other.
Expand Down
4 changes: 2 additions & 2 deletions src/Framework/Constraint/IsIdentical.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
/**
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*/
final readonly class IsIdentical extends Constraint
final class IsIdentical extends Constraint
{
private mixed $value;
private readonly mixed $value;

public function __construct(mixed $value)
{
Expand Down
4 changes: 2 additions & 2 deletions src/Framework/Constraint/JsonMatches.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
/**
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*/
final readonly class JsonMatches extends Constraint
final class JsonMatches extends Constraint
{
private string $value;
private readonly string $value;

public function __construct(string $value)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Framework/Constraint/Math/IsFinite.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
/**
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*/
final readonly class IsFinite extends Constraint
final class IsFinite extends Constraint
{
/**
* Returns a string representation of the constraint.
Expand Down
2 changes: 1 addition & 1 deletion src/Framework/Constraint/Math/IsInfinite.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
/**
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*/
final readonly class IsInfinite extends Constraint
final class IsInfinite extends Constraint
{
/**
* Returns a string representation of the constraint.
Expand Down
2 changes: 1 addition & 1 deletion src/Framework/Constraint/Math/IsNan.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
/**
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*/
final readonly class IsNan extends Constraint
final class IsNan extends Constraint
{
/**
* Returns a string representation of the constraint.
Expand Down
6 changes: 3 additions & 3 deletions src/Framework/Constraint/Object/ObjectEquals.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@
/**
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*/
final readonly class ObjectEquals extends Constraint
final class ObjectEquals extends Constraint
{
private object $expected;
private string $method;
private readonly object $expected;
private readonly string $method;

public function __construct(object $object, string $method = 'equals')
{
Expand Down
4 changes: 2 additions & 2 deletions src/Framework/Constraint/Object/ObjectHasProperty.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
/**
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*/
final readonly class ObjectHasProperty extends Constraint
final class ObjectHasProperty extends Constraint
{
private string $propertyName;
private readonly string $propertyName;

public function __construct(string $propertyName)
{
Expand Down
4 changes: 2 additions & 2 deletions src/Framework/Constraint/Operator/BinaryOperator.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@
/**
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*/
abstract readonly class BinaryOperator extends Operator
abstract class BinaryOperator extends Operator
{
/**
* @psalm-var list<Constraint>
*/
private array $constraints;
private readonly array $constraints;

protected function __construct(mixed ...$constraints)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Framework/Constraint/Operator/LogicalAnd.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
/**
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*/
final readonly class LogicalAnd extends BinaryOperator
final class LogicalAnd extends BinaryOperator
{
public static function fromConstraints(mixed ...$constraints): self
{
Expand Down
2 changes: 1 addition & 1 deletion src/Framework/Constraint/Operator/LogicalNot.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
/**
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*/
final readonly class LogicalNot extends UnaryOperator
final class LogicalNot extends UnaryOperator
{
public static function negate(string $string): string
{
Expand Down
2 changes: 1 addition & 1 deletion src/Framework/Constraint/Operator/LogicalOr.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
/**
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*/
final readonly class LogicalOr extends BinaryOperator
final class LogicalOr extends BinaryOperator
{
public static function fromConstraints(mixed ...$constraints): self
{
Expand Down
2 changes: 1 addition & 1 deletion src/Framework/Constraint/Operator/LogicalXor.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
/**
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*/
final readonly class LogicalXor extends BinaryOperator
final class LogicalXor extends BinaryOperator
{
public static function fromConstraints(mixed ...$constraints): self
{
Expand Down
2 changes: 1 addition & 1 deletion src/Framework/Constraint/Operator/Operator.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
/**
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*/
abstract readonly class Operator extends Constraint
abstract class Operator extends Constraint
{
/**
* Returns the name of this operator.
Expand Down

0 comments on commit f6a1f7c

Please sign in to comment.