It is currently impossible to implement a custom Constraint without triggering a static analysis error:
------ --------------------------------------------------------------------------------------------------------------------------------------
Line test/unit/Domain/Chat/MessageConstraint.php
------ --------------------------------------------------------------------------------------------------------------------------------------
26 Call to method __construct() of internal class PHPUnit\Framework\ExpectationFailedException from outside its root namespace PHPUnit.
🪪 method.internalClass
26 Instantiation of internal class PHPUnit\Framework\ExpectationFailedException.
🪪 new.internalClass
39 Call to method __construct() of internal class PHPUnit\Framework\ExpectationFailedException from outside its root namespace PHPUnit.
🪪 method.internalClass
39 Instantiation of internal class PHPUnit\Framework\ExpectationFailedException.
🪪 new.internalClass
------ --------------------------------------------------------------------------------------------------------------------------------------
Expected behavior
ExpectationFailedException should not be marked as internal, or Constraint should allow throwing other kind of exceptions.
It is currently impossible to implement a custom
Constraintwithout triggering a static analysis error:Expected behavior
ExpectationFailedExceptionshould not be marked as internal, orConstraintshould allow throwing other kind of exceptions.