You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CURRENT BEHAVIOUR
As it currently stands, while Assert.php has both valid and informative @throws docs, Functions.php has some legacy (and absurd) - e.g. assertContains is currently declared as:
Functions.php
/**
* Asserts that a haystack contains a needle.
*
* @throws Exception
* @throws ExpectationFailedException
* @throws \PHPUnit\Framework\Exception
* @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
*/
{
Assert::assertContains(...\func_get_args());
}
Assert.php
/**
* Asserts that a haystack contains a needle.
*
* @throws ExpectationFailedException
* @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
*/
// ... actual code
RATIONALE FOR CHANGE
This makes maintaining tests which use the function form extremely tedious, since IDEs generally bitch about uncaught exceptions, especially with @throws Exception.
EXPECTED BEHAVIOUR
tl;dr because Functions.php is only a wrapper, functions in it should have exactly same @throws as corresponding methods from Assert.php
POSSIBLE ISSUES WITH FIXING
None that I am aware of.
POSSIBLE WORKAROUNDS
Either not using functions, or suppressing the IDE warnings about uncaught exceptions.
The text was updated successfully, but these errors were encountered:
CURRENT BEHAVIOUR
As it currently stands, while
Assert.php
has both valid and informative@throws
docs,Functions.php
has some legacy (and absurd) - e.g.assertContains
is currently declared as:Functions.php
Assert.php
RATIONALE FOR CHANGE
This makes maintaining tests which use the function form extremely tedious, since IDEs generally bitch about uncaught exceptions, especially with
@throws Exception
.EXPECTED BEHAVIOUR
tl;dr because
Functions.php
is only a wrapper, functions in it should have exactly same@throws
as corresponding methods fromAssert.php
POSSIBLE ISSUES WITH FIXING
None that I am aware of.
POSSIBLE WORKAROUNDS
Either not using functions, or suppressing the IDE warnings about uncaught exceptions.
The text was updated successfully, but these errors were encountered: