ExceptionNameSniff
DocbookCS.ExceptionName
Flags class names wrapped in <classname> whose base name ends with Exception,
Error, or Throwable. DocBook provides <exceptionname> specifically for
exception names; using <classname> for them is incorrect markup.
A <classname> directly inside <ooclass> is skipped.
Auto-fixable
This sniff ships a fixer — run with --fix to rewrite the
element to <exceptionname> automatically.
Properties
| Property | Type | Default | Description |
|---|---|---|---|
severity | string | error | Override the violation severity. Accepted values: error, warning. |
What it catches
Wrong
<classname>RuntimeException</classname>
<classname>TypeError</classname>
Correct
<exceptionname>RuntimeException</exceptionname>
<exceptionname>TypeError</exceptionname>
Regular class names are not affected:
Not flagged
<classname>ArrayObject</classname>