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

Factor out logic that tracks mapping inheritance #10397

Merged
merged 1 commit into from
Jan 16, 2023

Conversation

mpdude
Copy link
Contributor

@mpdude mpdude commented Jan 13, 2023

While working on #10396, I noticed the three kinds of mapping information track inherited and declared in the same way.

This PR suggests move the common code into a dedicated method, making it easier to see and understand where the information comes from.

@mpdude
Copy link
Contributor Author

mpdude commented Jan 14, 2023

Would appreciate any help how to fix static analysis type hinting here

@greg0ire
Copy link
Member

Would appreciate any help how to fix static analysis type hinting here

I've tried looking into it, and it's a nightmare. I think the right course of action would be to experiment with DTOs on 3.0.x. That would allow us to determine where to use which type hint, and whether any fields are missing in the type aliases defined at the beginning of ClassMetadataInfo… would you be willing to work on this? I think in any case, you can reset to HEAD^ and add the error you get to the baseline.

@mpdude
Copy link
Contributor Author

mpdude commented Jan 14, 2023

I've tried looking into it, and it's a nightmare.

Probably thats because introducing a tool like Psalm into a huge legacy codebase is not fun, eh?

@mpdude
Copy link
Contributor Author

mpdude commented Jan 14, 2023

How do I add a phpcs error to the baseline?

@greg0ire
Copy link
Member

Probably thats because introducing a tool like Psalm into a huge legacy codebase is not fun, eh?

Yeah it's kind of a pain, thankfully there is a baseline.

@greg0ire
Copy link
Member

How do I add a phpcs error to the baseline?

I'd rather we add Psalm issues to the baseline, so I'd make phpcs happy, then ignore Psalm.

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.

Please squash everything into one commit that passes the build.

lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php Outdated Show resolved Hide resolved
@mpdude mpdude force-pushed the factor-out-mapping-info branch from 02963eb to a840f49 Compare January 14, 2023 16:47
@mpdude
Copy link
Contributor Author

mpdude commented Jan 14, 2023

🟢 , without updating the baseline file 🥳

greg0ire
greg0ire previously approved these changes Jan 14, 2023
@greg0ire
Copy link
Member

Nice job!

@greg0ire
Copy link
Member

I think this should target 2.15.x (it's not a bugfix)

@mpdude mpdude force-pushed the factor-out-mapping-info branch from a840f49 to 85fd41e Compare January 14, 2023 22:48
@mpdude mpdude changed the base branch from 2.14.x to 2.15.x January 14, 2023 22:48
@mpdude
Copy link
Contributor Author

mpdude commented Jan 14, 2023

Rebased onto 2.15.x

greg0ire
greg0ire previously approved these changes Jan 14, 2023
SenseException
SenseException previously approved these changes Jan 14, 2023
Copy link
Member

@SenseException SenseException left a comment

Choose a reason for hiding this comment

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

👍

@mpdude mpdude dismissed stale reviews from SenseException and greg0ire via 1612744 January 15, 2023 20:41
@mpdude mpdude force-pushed the factor-out-mapping-info branch from 1612744 to b83eeaf Compare January 15, 2023 20:49
@derrabus derrabus merged commit a8ef69d into doctrine:2.15.x Jan 16, 2023
@derrabus
Copy link
Member

Thank you!

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