-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Be less restrictive in DiscriminatorColumnMapping phpdoc #11226
Conversation
86ff6bb
to
f3160eb
Compare
* length?: int, | ||
* fieldName?: string|null, | ||
* type?: string|null, | ||
* length?: int|null, |
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.
DiscriminatorColumnMapping use
public int|null $length = null;
so a null length seems valid.
* type?: string, | ||
* length?: int, | ||
* fieldName?: string|null, | ||
* type?: string|null, |
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 is an isset check
if (! isset($columnDef['type'])) {
$columnDef['type'] = 'string';
}
so null is handled.
* fieldName?: string, | ||
* type?: string, | ||
* length?: int, | ||
* fieldName?: string|null, |
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 is an isset check
if (! isset($columnDef['fieldName'])) {
$columnDef['fieldName'] = $columnDef['name'];
}
so null is handled
This should target 3.1.x I think, since it's no bugfix. |
This would help some projet to add easily support for ORM v3 without having to ignore multiple static analysis error. Also, the fact we added
is kinda a bugfix. The phpdoc was saying a null options was accepted, but it wasn't since |
🤔 you're right I think, so it's weird that the baseline is not reduced as a consequence. Since your changes are not very substantial, I'm OK with staying on 3.0.x if that helps. |
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.
👍🏻 once PHPCS is happy.
Done :) |
* 3.0.x: Test different ways of settings query parameters Be less restrictive in DiscriminatorColumnMapping phpdoc (doctrine#11226) Allow (Array)ParameterType in QueryBuilder
* 3.1.x: Backport QueryParameterTest (#11288) Test different ways of settings query parameters Be less restrictive in DiscriminatorColumnMapping phpdoc (#11226) Allow (Array)ParameterType in QueryBuilder Do not implicitly cast glob's return type Do not cast file_put_contents's return type Do not implicitly cast getLockTime()'s return type Do not implicitly cast getLockContent()'s return value
Currently static analysis returns error when writing
with errors like the fact that the array need to have keys like
length?: int
but receivedlength?: int|null
.But since
DiscriminatorColumnMapping
is usingnull
as default value, it should allow both