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

Improve phpdoc about list #315

Merged
merged 1 commit into from
Nov 18, 2022
Merged

Improve phpdoc about list #315

merged 1 commit into from
Nov 18, 2022

Conversation

VincentLanglet
Copy link
Contributor

I got an error from phpstan for the following code

$tool = new SchemaTool($manager);
$tool->dropSchema($manager->getMetadataFactory()->getAllMetadata());

Parameter #1 $classes of method Doctrine\ORM\Tools\SchemaTool::dropSchema() expects list<Doctrine\ORM\Mapping\ClassMetadata>,
array<Doctrine\ORM\Mapping\ClassMetadata> given.

Looking at the getAllMetadata implementation the return value is a list.
So I tried updated some phpdoc when the method is returning a list.

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.

Should go to 3.1.x, as the current types are technically correct

@VincentLanglet VincentLanglet changed the base branch from 3.0.x to 3.1.x November 18, 2022 13:31
@VincentLanglet
Copy link
Contributor Author

Should go to 3.1.x, as the current types are technically correct

I personally would have prefer this to be released asap to avoid static analysis issues with

$tool->dropSchema($manager->getMetadataFactory()->getAllMetadata());

but I understand.

I updated the branch.

@greg0ire
Copy link
Member

I will look into doing a release soon, ping me if I don't :)

@greg0ire greg0ire added this to the 3.1.0 milestone Nov 18, 2022
@greg0ire greg0ire added the Enhancement New feature or request label Nov 18, 2022
@greg0ire greg0ire merged commit 2a9c70a into doctrine:3.1.x Nov 18, 2022
@VincentLanglet VincentLanglet deleted the list branch November 18, 2022 14:28
@X-Coder264
Copy link

X-Coder264 commented Feb 3, 2023

@greg0ire Can we please have this backported to v2 branch and tag a new release as v2 has the same problem that this PR solved for v3 so the CI build on our project is currently failing. I can do the backport if the change is gonna be merged.

@greg0ire
Copy link
Member

greg0ire commented Feb 3, 2023

Yes:

"maintained": true

@X-Coder264 X-Coder264 mentioned this pull request Feb 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants