coding-standard icon indicating copy to clipboard operation
coding-standard copied to clipboard

Sniff to check that only exceptions from specific (app) namespaces are thrown

Open Majkl578 opened this issue 7 years ago • 0 comments

Having an app within My\App namespace, I'd like to only allow throwing exceptions from My\App or any sub-namespace - no SPL, no global Exception/Error.

This should be really straightforward, but I can see a potential use case for extended behavior: specifying boundaries and their allowed exceptions. Example:

  • My\App\FooContext can only throw My\App\FooContext\*
  • My\App\BarContext can only throw My\App\BarContext\*

cc @simPod

Majkl578 avatar Sep 23 '18 04:09 Majkl578