Skip to content
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

Update ClassMetadataInfo::table definition #9703

Merged
merged 3 commits into from
May 1, 2022

Conversation

pbourdet
Copy link
Contributor

Hello,

I recently encountered an issue when bumping the phpstan level of my project.

The code

$constraints = $metadata->table['uniqueConstraints'] ?? [];

is reported as an error because uniqueConstraints is always set.

But when I dump the value, it seems that sometimes, only the name key is set.
image

Everything except the name key might be undefined when accessing to this public property, for instance in a loadClassMetadata event.

Everything except the name key might be undefined when accessing to this public property, for instance in a LoadMetadataEvent
greg0ire
greg0ire previously approved these changes Apr 30, 2022
Copy link
Member

@greg0ire greg0ire left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In addition to your debugger screenshot, the baseline update shows that this is going in the right direction 👍

@pbourdet
Copy link
Contributor Author

In addition to your debugger screenshot, the baseline update shows that this is going in the right direction 👍

Yes :)

I tried to update the baseline to make the tests pass.

@greg0ire
Copy link
Member

I tried to update the baseline to make the tests pass.

Well try again 😛

@pbourdet
Copy link
Contributor Author

Well try again 😛

I did it 🥳

@greg0ire greg0ire merged commit 86ce0e5 into doctrine:2.12.x May 1, 2022
@greg0ire
Copy link
Member

greg0ire commented May 1, 2022

Thanks @pbourdet !

@pbourdet pbourdet deleted the patch-1 branch May 1, 2022 13:22
@derrabus derrabus added this to the 2.12.2 milestone May 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants