## Exceptions
#### SlevomatCodingStandard.Exceptions.DeadCatch
This sniff finds unreachable catch blocks:
```php
try {
doStuff();
} catch (\Throwable $e) {
log($e);
} catch (\InvalidArgumentException $e) {
// unreachable!
}
```
#### SlevomatCodingStandard.Exceptions.DisallowNonCapturingCatch
This sniff forbids use of non-capturing catch introduced in PHP 8.0 [PHP RFC: non-capturing catches](https://wiki.php.net/rfc/non-capturing_catches).
#### SlevomatCodingStandard.Exceptions.ReferenceThrowableOnly 🔧🚧
In PHP 7.0, a [`Throwable` interface was added](https://wiki.php.net/rfc/throwable-interface) that allows catching and handling errors in more cases than `Exception` previously allowed. So, if the catch statement contained `Exception` on PHP 5.x, it means it should probably be rewritten to reference `Throwable` on PHP 7.x. This sniff enforces that.
#### SlevomatCodingStandard.Exceptions.RequireNonCapturingCatch 🔧
Sniff provides the following settings:
* `enable`: either to enable or not this sniff. By default, it is enabled for PHP versions 8.0 or higher.
It requires non-capturing catch when the variable with exception is not used.
| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| arrays.md | File | 1.58 KB | 0644 |
|
| attributes.md | File | 1.75 KB | 0644 |
|
| classes.md | File | 13.82 KB | 0644 |
|
| commenting.md | File | 5.72 KB | 0644 |
|
| complexity.md | File | 288 B | 0644 |
|
| control-structures.md | File | 9.32 KB | 0644 |
|
| exceptions.md | File | 1.14 KB | 0644 |
|
| files.md | File | 2.54 KB | 0644 |
|
| functions.md | File | 5.21 KB | 0644 |
|
| namespaces.md | File | 7.76 KB | 0644 |
|
| numbers.md | File | 625 B | 0644 |
|
| operators.md | File | 1.11 KB | 0644 |
|
| php.md | File | 3.09 KB | 0644 |
|
| strings.md | File | 392 B | 0644 |
|
| type-hints.md | File | 10.71 KB | 0644 |
|
| variables.md | File | 749 B | 0644 |
|
| whitespaces.md | File | 623 B | 0644 |
|