doctrine / DoctrineMongoDBBundle

Integrates Doctrine MongoDB ODM with Symfony
http://symfony.com/doc/current/bundles/DoctrineMongoDBBundle/index.html
MIT License
382 stars 230 forks source link

Basic implementation of psr6 compatibility pass #690

Closed Ahummeling closed 3 years ago

Ahummeling commented 3 years ago

After meeting with @alcaeus we came to the conclusion that it would be best to first implement psr6 compatibility, before moving forward with removing the metadata cache configuration. This pull request is aimed at implementing this compatibility, through means of a compiler pass.

Wanted to get a tiny bit of feedback as I am continuing to figure out which tests cause deprecation triggers, figure out what happens when I install this version in 1 of my projects and all that stuff.

Will be leaving some comments on my first commit to explain certain choices or things that might appear odd

franmomu commented 3 years ago

Thanks @Ahummeling! In order to fix the build, can you please execute vendor/bin/phpcbf to fix the coding standard issues (you can check with vendor/bin/phpcs if it is fine).

The failing test should be fixed if you rebase with 4.4.x.

Ahummeling commented 3 years ago

just need to have a testcase added for the compiler pass now and this should be complete

franmomu commented 3 years ago

@Ahummeling I've rebased, tried to add tests for the compiler pass (based on the ORM) and fixed some psalm issues, finally I've flipped the alias arguments to make tests pass, but not sure if I was right about that last one 🤔 cc @alcaeus

IonBazan commented 3 years ago

I've rebased, resolved conflicts and added a dummy assertion to make PHPUnit report the coverage for that CompilerPass test. @franmomu can you help to fix the static analysis issues? Maybe we can just revert these phpdoc changes for now?

franmomu commented 3 years ago

Not sure why doesn't infer correctly that class string type 😕, maybe because of generics.

IonBazan commented 3 years ago

Thanks, it looks good now!

@alcaeus this is ready for review now.

IonBazan commented 3 years ago

Thank you @Ahummeling! 🚀