-
-
Notifications
You must be signed in to change notification settings - Fork 508
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
[DX] Adding bool and integer types and annotations #1073
Conversation
Shouldn't we, by the same reasoning, also add an "Integer" type? :) |
@gerryvdm If we end up merging this I'm totally fine with having |
👍 for bool |
👍, and Integer should exist too. |
I assume the "alias" classes, which are really for annotations, will just extend the existing one. Is that correct? I've no objections to creating both "Bool" and "Integer". Is this DX suggestion relevant to ORM? |
@jmikola can't really extend existing one since it's final and I didn't want to change that. Also by registering normal type it should work for YAML/XML mappings out of the box Haven't used ORM in quite a while but IIRC they had something like |
I have to ask a totally noob question, but what does DX mean? Scott |
@smolinari Developer eXperience :) |
@malarzm Could you update your PR to support |
@lavoiesl I'll do that later today or tomorrow, don't worry ;) |
@malarzm Oh, duh! Thanks for reminding me. I actually just read a few weeks ago the blog about the push Symfony is making on DX. I should have guessed that. I just couldn't put it together in context to the discussion here. Enough excuses. I am simply a noob. LOL! Scott |
|
[DX] Adding bool and integer types and annotations
@jwage: Spoke in IRC about this. DBAL has "boolean" and "integer" mappings, while we only had "boolean" and "int". @malarzm raises a point that this would break anyone with custom "integer" or "bool" types defined, but I don't think that's likely to affect very many users (why would you have a custom "bool" type that differs significantly from the stock "boolean" type?). I'm 👍 on this, but I also accept that ORM does not want the aliases due to BC concerns. On the plus side, this PR will make our "int" type consistent with ORM's "integer" type name. |
I keep using
@ODM\Bool
annotation and later swearing it doesn't exist and changing to full@ODM\Boolean
. Here are some pros of adding this:int
type, notinteger
bool
bool
is common in all languagesThe only downside of this I see is that if somebody would have already done that on his own via
Type::addType
he will get exception now.