2121
2222use PHPUnit \Framework \Constraint \Constraint ;
2323use PHPUnit \Framework \Constraint \IsEqual ;
24- use PHPUnit \Framework \Exception as PHPUnitException ;
2524use PHPUnit \Framework \ExpectationFailedException ;
2625use PHPUnit \Framework \InvalidArgumentException ;
2726use PhrozenByte \PHPUnitThrowableAsserts \CallableProxy ;
3130/**
3231 * Abstract base class for the `CallableThrows` and `CallableThrowsNot`
3332 * constraints implementing some common methods.
33+ *
34+ * @internal
3435 */
3536abstract class AbstractCallableThrows extends Constraint
3637{
@@ -54,7 +55,7 @@ abstract class AbstractCallableThrows extends Constraint
5455 * @param int|string|null $code value to match the Throwable's code
5556 * @param bool $exactMatch whether an exact match of the Throwable's class is required
5657 *
57- * @throws PHPUnitException
58+ * @throws InvalidArgumentException
5859 */
5960 public function __construct (string $ className , $ message , $ code , bool $ exactMatch )
6061 {
@@ -74,7 +75,16 @@ public function __construct(string $className, $message, $code, bool $exactMatch
7475 }
7576
7677 /**
77- * {@inheritDoc}
78+ * Throws a ExpectationFailedException exception for the compared value.
79+ *
80+ * @param mixed $other evaluated value or object
81+ * @param string $description additional information about the test
82+ * @param ComparisonFailure|null $comparisonFailure additional information about string inequality
83+ * @param Throwable|null $throwable instance of a unexpectedly thrown Throwable
84+ *
85+ * @throws ExpectationFailedException
86+ *
87+ * @psalm-return never-return
7888 */
7989 protected function fail (
8090 $ other ,
@@ -105,7 +115,7 @@ protected function fail(
105115 }
106116
107117 /**
108- * Returns additional failure description for a Throwable
118+ * Returns additional failure description for a Throwable.
109119 *
110120 * @param Throwable|null $throwable the Throwable that was thrown
111121 *
@@ -133,7 +143,14 @@ protected function throwableFailureDescription(?Throwable $throwable): string
133143 }
134144
135145 /**
136- * {@inheritDoc}
146+ * Returns the description of the failure.
147+ *
148+ * The beginning of failure messages is "Failed asserting that" in most
149+ * cases. This method should return the second part of that sentence.
150+ *
151+ * @param mixed $other the evaluated value
152+ *
153+ * @return string the failure description
137154 */
138155 protected function failureDescription ($ other ): string
139156 {
@@ -149,7 +166,7 @@ protected function failureDescription($other): string
149166 }
150167
151168 /**
152- * {@inheritDoc}
169+ * Returns the number of assertions performed by this Constraint.
153170 */
154171 public function count (): int
155172 {
0 commit comments