-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Document conventions for abstract class naming. #922
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
the point here is that it is not always done. @fabpot thoughts about it ? |
I think it's mostly me who doing this, haven't seen anyone else doing it. |
There is no harm adding this now for use from now onwards. The naming conventions really help a lot, even if it's not always done in the Sf2 core. Naming conventions make the code look good, and make it clear to understand what is what. |
Excuse me, but is this an applied coding standard in Symfony 2? Or is it still pending and being discussed? |
I agree with this convention, having the Abstract as the prefix does give hinting to the implementations. |
👍 |
This is not a coding standard that's actually followed in all cases in the core, but it is probably a good idea. It's a really small deal either way, but this will ultimately probably need the thumbs up/down from @fabpot Thanks! |
+1 |
+1 |
bump. |
Hi guys! We still don't really have a consensus one way or another on this, but I've patched this into the 2.0 branch at sha: f39b4c4 with a tweak to make the language less strong at sha: a4ca0f8. Hopefully it looks like a nice recommendation, but the language is consistent with the fact that this is not done in core in many cases. And if we hate this, we can always reverse later - but this pushes the issue along :). Thanks! |
I know there is not consistency, but it's definitely the growing trend, even in Symfony. For new stuff it makes very much good sense to implement (and is what's happening in many places in the PHP world - something we discovered on the PHP-FIG group during the last discussions of PSR-3). It would be better if you put a foot note in the standards to say that in the beginning some of these things were not followed, but we should following them looking forward. You can see the overwhelming support garnered for this: here and a poll (which I cant find atm) found most of the big projects are following this convention looking forward. I would therefor suggest removing recommends, and just adding a footnote to explain why there is disparity in some cases. |
…ten a good idea, but definitely not always followed in core
@Drak I also like the suffix, though looking through the core code where it's not used, there are a few places where - if we did use it - it feels awkward. For example, we have the non-static Let me know your thoughts - I'm happy either way - and I think this is a pretty minor issue - but I want a bit of a consensus/mandate before using stronger language for a standard that we don't see in all of core. Thanks! |
I've submitted a PR which some suggested wording. It's very important the language is not MAY but MUST because Symfony is very much using Abstract nowadays as are many many large OSS projects. This is very much a convention already. We've delayed this update to the documentation for way too long which only serves to further make the ambiguity. in direct answer to your question, yes, it definitely would be |
No description provided.