-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Introduce a ArrayParameterType
enum
#5838
Introduce a ArrayParameterType
enum
#5838
Conversation
45d7a61
to
c6bdad1
Compare
*/ | ||
public const ARRAY_PARAM_OFFSET = 100; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm fine with this removal because it's internal. How do others see this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Favorably
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ORM seems use it #5837 (comment) and if doctrine/dbal and doctrine/orm is not a match it will fail. So for bc reasons when I think it need to be kept if somebody is only updating doctrine/dbal and not doctrine/orm. Else doctrine/dbal 3.6.0 would require to set a conflict to all doctrine/orm versions lower than a supported version that version to avoid that older none compatible orm versino is used, setting requirement on doctrine/orm side would not work as current orm version already supports ^3.6.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. I'll restore the constant.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@derrabus Thank you!
Summary
This PR deprecates the
Connection::PARAM_*_ARRAY
constants in favor of a newArrayParameterType
class that I'd like to turn into an enum in 4.0.x. My motivation is that those constants are still arbitrary integers and cannot be typed properly on PHP 8. Array parameters are also the only remaining scenario in which a parameter type is expressed as an integer. Transitioning to an enum would allow us to eliminate integers.Since we already have a
ParameterType
enum, it makes sense to create an enum for those group of types as well.The PR also adds a test that is going to fail on 4.0.x and thus reproduces #5837.