-
Notifications
You must be signed in to change notification settings - Fork 61
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
RFC Datetime and Date class name #71
Comments
That could potentially be painful for end users, since using both \DateTime and Chronos\DateTime in the same class would require aliasing. |
And the other 3 don't have a core PHP counterpart you mean? One could probably argue that using both in the same class file is usually a not a good idea. Or should make use of some aliasing like
or manually
etc. Since the goal of using this Chronos DateTime class is to make things more consistent you should be using it everywhere to be able to leverage that. Using the PHP core one on top in the same files should be the exception to the rule in that case. But I understand what you mean. |
Yeah, that's what I mean... In general I don't like class names to be repeated, even if we have namespaces, because reading the code becomes more difficult |
In that case pre- or suffixing is usually the way to go, but |
What about: class Chronos extends Chronos\DateTime That way users that want to just use the Chronos version can, and all others can use the Chronos name. |
That sounds like a fair (and BC) compromise. |
PR #74 is open so discution can take place there. |
The more I use it and think about it the more sense it would make to have a consistent naming scheme for the class names.
Afaik the only reason was namespace clashing/confusion.
But with all the other 3 classes around I think the confusion is rather internal now, with Chronos not just as namespace but also as class name sticking out here.
Chronos
also does not say anything about the type of date it contains or can work on ( is it Date, or DateTime or just Time or ...). For me that is a cool package name, but not a very explaning class name.Thus I think DateTime would indeed be the more sane name for the Chronos class IMO.
We can change it now before releasing a 1.0.0.
The text was updated successfully, but these errors were encountered: