Page MenuHomePhabricator

Enable phan rules to warn against checked exception that are thrown but not documented
Open, Needs TriagePublic

Description

If a method throws a checked exception, then said exception should be documented in the method's doc comment with @throws. Phan can check this with the warn_about_undocumented_throw_statements option, so we should enable it.

While doing so, we should also specify what exception classes should be considered unchecked, meaning they should not be documented with @throws. This is configurable with the exception_classes_with_optional_throws_phpdoc option. The current proposal is to configure LogicException and RuntimeException (and all their subclasses) as unchecked.