-
Notifications
You must be signed in to change notification settings - Fork 51
Add rule about exception namespace #37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
I disagree with this one: I like to have a nice catalog of "things that can go wrong" under Mixing them all together with the actual non-exceptional code is not really helpful |
Another note that might make you reconsider @Ocramius , in my ORM PR, the exceptions are the only things that are namespaced in a component. For instance, |
For |
@greg0ire I wouldn't put them in the |
Here is a view of how it looks right now:
How do we reorganize this and keep it manageable? |
Yep, I really think that's making the locating of exceptions and implementations quite confusing |
An option could be to move |
My current preference is to just have |
The |
I think this is going towards cache exception in |
Yeah, I'm talking about examples where the Let's call them
|
Yeah, not grouping by kind is not realistic when you have lots and lots of classes of that kind (way more than other kinds), So let's go with that. Just to be sure we agree, in my ORM PR, that will result in:
|
3ad13ec
to
f79e04e
Compare
Pushed a new version to reflect the desired policy |
Another edge-case: there is a class named |
@greg0ire given |
In a larger code base, it's not realistic and will be chaotical. The root exception interface declares the catalogue. Given the changes in ORM and Migrations, this is imho good to go. |
I concur. Do we have a sniff readily available or do we need to create it? |
Well, this PR is not a sniff, but a not fixable rule in README only. |
@SenseException Do you think we can cherry-pick this into your #63? |
Yes, I can do that. |
closing here - consumed by #63 |
Continuing the series of rules PRs, this is a more controversial one. Yay or Nay?
This will result in use statements, and will make spotting badly namedexceptions easier: if you are confused about a class being an exception
or not, then the naming is bad. Also, shallower trees. Things should be
grouped by feature/component, not by kind, no exceptions (pun intended).
Changed to
Exception
subnamespaces