doctrine / data-fixtures

Doctrine2 ORM Data Fixtures Extensions
http://www.doctrine-project.org
MIT License
2.78k stars 224 forks source link

Add parameter types #455

Closed GromNaN closed 10 months ago

GromNaN commented 10 months ago

In DoctrineMongoDBBundle, we can't add parameter types to all the classes because they are not defined in the base class or the interface. https://github.com/doctrine/DoctrineMongoDBBundle/pull/812/files#diff-1571e1997e046b65a3fdffae3826e46e2a5a89adcce01ff580557d7eedc536e1R71

Adding parameter types to all the methods should not be an issues for classes that extends them. But it might for interfaces.

Also upgrading to PHP 8.1 is required for some mixed and union types.

derrabus commented 10 months ago

This PR does too many things. Let's start small please.

Let's start with parameter types only. Bumping to 8.1 does not yet feel necessary to me. We should not have many union types in parameters and mixed is the only parameter type that you may add downstream.

GromNaN commented 10 months ago

Indeed, I went too far. Reworking.

GromNaN commented 10 months ago

It did not change the type for ORMPurger::getJoinTableName which requires an union `. AlsoReferenceRepository::setReferenceIdentityhas amixed` argument.

Nothing needs to be updated in tests.

GromNaN commented 10 months ago

Once this PR is merged, we might open a 2.0 branch where we bump to 8.1 and apply return types, WDYT?

Sounds like a good idea. There is little deprecated things to remove, and we could add return types.

greg0ire commented 10 months ago

Thanks @GromNaN !