Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
ghost wants to merge1 commit intosymfony:masterfromunknown repository
Closed

Document conventions for abstract class naming.#922

ghost wants to merge1 commit intosymfony:masterfromunknown repository

Conversation

ghost
Copy link

No description provided.

@stof
Copy link
Member

the point here is that it is not always done.@fabpot thoughts about it ?

@schmittjoh
Copy link
Contributor

I think it's mostly me who doing this, haven't seen anyone else doing it.

@ghost
Copy link
Author

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.

@yoannch
Copy link

Excuse me, but is this an applied coding standard in Symfony 2? Or is it still pending and being discussed?

@hppycoder
Copy link

I agree with this convention, having the Abstract as the prefix does give hinting to the implementations.

@stephpy
Copy link
Contributor

👍

@weaverryan
Copy link
Member

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!

@Nemesisprime
Copy link

+1
A little standardization is never frowned upon.

@carlalexander
Copy link

+1

@ghost
Copy link
Author

bump.

@weaverryan
Copy link
Member

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!

@ghost
Copy link
Author

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.

weaverryan added a commit that referenced this pull requestDec 16, 2012
…ten a good idea, but definitely not always followed in core
@weaverryan
Copy link
Member

@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-staticHttpKernel in the component, then it's abstract sub-classHttpKernel in FrameworkBundle. If we did everything all over again, would we even prefix these classes withAbstract?

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!

@ghost
Copy link
Author

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 beAbstractHttpKernel if it was written from scratch. Look at the Form component as an example.#2033

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

8 participants
@stof@schmittjoh@yoannch@hppycoder@stephpy@weaverryan@Nemesisprime@carlalexander

[8]ページ先頭

©2009-2025 Movatter.jp