laminas / laminas-diagnostics

A set of components for performing diagnostic tests in PHP applications
https://docs.laminas.dev/laminas-diagnostics/
BSD 3-Clause "New" or "Revised" License
55 stars 32 forks source link

Add `@throws` tag to `CheckInterface::check()` #23

Closed ihmels closed 3 years ago

ihmels commented 3 years ago
Q A
Documentation no
Bugfix no
BC Break no
New Feature no
RFC no
QA yes

Description

In CheckInterface::check() it is also possible to throw an exception instead of returning an object of type ResultInterface. This exception is then converted to a Failure in Runner::run(). This should be reflected in the PHPDoc via a throws tag in my opinion.

This also has the advantage that e.g. PhpStorm does not show a warning if you intentionally do not catch an exception in your own checker.

Signed-off-by: Yannick Ihmels yannick@ihmels.org