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
How to create schema using Schema tool in v2.9.x? #8642
Comments
That was me in 7104489 , right? But the class metadata factory of the entity manager can only return I think something similar to orm/lib/Doctrine/ORM/EntityManagerInterface.php Lines 37 to 38 in 06fadcd
Doctrine\ORM\Mapping\ClassMetadataFactory to declare that getAllMetadata() in fact returns a list<Doctrine\ORM\Mapping\ClassMetadata> .
Can you try adding such a comment in that class to confirm that it does solve the issue? UPD: the above has been contributed to 2.8.x, but is not yet merged up, so you would have to copy that too.
According to PHP or PHPStan? I'm trying to determine if there is a BC-break here , e.g. is there a reasonable scenario where we would really pass non-instances |
Wouldn't AbstractClassMetadataFactory need to implement Psalm generics/template to make this possible? |
I think it would be one way to do it, but there is I think another way to do this by using
|
This fixes an SA regression introduced when using stricter types in SchemaTool. Fixes doctrine#8642
SchemaTool::createSchema()
expectslist<Doctrine\ORM\Mapping\ClassMetadata>
.I used to pass in metadata created as
$entityManager->getMetadataFactory()->getAllMetadata()
that returnsarray<Doctrine\Persistence\Mapping>
so it's incompatible now.I checked this I but seems to have the same issue
orm/lib/Doctrine/ORM/Tools/Console/Command/SchemaTool/AbstractCommand.php
Lines 58 to 66 in bcb4889
The text was updated successfully, but these errors were encountered: