WP_Mock adds some function mocks for some common WP functions (mostly gettext related) that are expected to return the arg they are passed to (such as in gettext, when no translations are applied).
In WP_Mock because they are funneled to an handler, this could technically throw an assertion exception (relevant to tests only). However, because these mocks have the same name as WP functions, the result is that the IDE or some static analyzers will assume they will throw an uncaught exception in the codebase, which isn't true. The solution in #245 improves phpdocs so that this false positive should no longer happen.
Replication steps
This happened to me when working at some WP codebase where WP Mock was included as dev dependency in PHPStorm.
Expected behavior
PHPStorm shouldn't flag those functions as throwing exceptions, because that's not what they do in WP.
Bug report
WP_Mock adds some function mocks for some common WP functions (mostly gettext related) that are expected to return the arg they are passed to (such as in gettext, when no translations are applied).
In WP_Mock because they are funneled to an handler, this could technically throw an assertion exception (relevant to tests only). However, because these mocks have the same name as WP functions, the result is that the IDE or some static analyzers will assume they will throw an uncaught exception in the codebase, which isn't true. The solution in #245 improves phpdocs so that this false positive should no longer happen.
Replication steps
This happened to me when working at some WP codebase where WP Mock was included as dev dependency in PHPStorm.
Expected behavior
PHPStorm shouldn't flag those functions as throwing exceptions, because that's not what they do in WP.