Open kschatzle opened 1 year ago
Awesome, thanks for the feedback. Seems like you're ok with the BC breaks in signatures.
@kschatzle it would be better if ArgumentTypeNode and ReturnTypeNode could have a BC layer for their getTypes
method (this BC layer can throw an exception when an intersection type is found, hinting at using the new API to support it). And even better if we can provide a BC layer for the existing constructor signature (with deprecation warnings).
@kschatzle Is this something still actively being worked on. Can I help out in any way?
I need to get back to this eventually when I have time. Some IRL stuff.
Doctrine has changed the return type from ObjectRepository to EntityRepository https://github.com/doctrine/DoctrineBundle/blob/2.12.x/src/Repository/RepositoryFactoryCompatibility.php (in ORM 3.x). This triggers now the following error in phpspec "doubling intersection types is not supported"
@dannyvw how is this related ? There is no union type nor intersection type in this trait
@stof The issue is related to the changes inside EntityRepository (https://github.com/doctrine/orm/blob/3.1.x/src/EntityRepository.php) and the return type change. If you have a test case like below then it triggers this error "doubling intersection types is not supported".
public function let(EntityManagerInterface $entityManager, EntityRepository $repository): void
{
$entityManager->getRepository(SomeEntity::class)->willReturn($repository);
}
I doubt the code you linked is relevant then, as there is no intersection type anywhere in this file.
Anyway, this PR is not ready to be merged. If you want this to move forward without waiting for the author to get back to it, an option is to take over the work to finish it.
Not sure either but the EntityRepository was the class inside the error. This error "doubling intersection types is not supported" is only triggered when upgrading doctrine/orm from 2.19 to 3.x.
Not close to finishing, but what do you think about the direction before I get everything ironed out? (Not all unit tests pass yet).
535