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

ClassMetadataInfo uses deprecated doctrine/common class #7306

Closed
simonwelsh opened this issue Jul 13, 2018 · 6 comments
Closed

ClassMetadataInfo uses deprecated doctrine/common class #7306

simonwelsh opened this issue Jul 13, 2018 · 6 comments
Assignees
Labels
Milestone

Comments

@simonwelsh
Copy link

BC Break Report

Q A
BC Break yes
Version 2.6.2

Summary

After upgrading to 2.6.2, which included an upgrade to doctrine/common:2.9.0, PHPUnit now fails with:
1x: Doctrine\Common\ClassLoader is deprecated.

Previous behavior

No deprecation errors were shown from using non-deprecated methods

Current behavior

Doctrine\Common\ClassLoader is deprecated
/Users/simon/projects/stokl/backend/vendor/doctrine/common/lib/Doctrine/Common/ClassLoader.php:7
/Users/simon/projects/stokl/backend/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php:1028
/Users/simon/projects/stokl/backend/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php:266
/Users/simon/projects/stokl/backend/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php:245
/Users/simon/projects/stokl/backend/vendor/doctrine/persistence/lib/Doctrine/Common/Persistence/Mapping/AbstractClassMetadataFactory.php:305
/Users/simon/projects/stokl/backend/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php:78
/Users/simon/projects/stokl/backend/vendor/doctrine/persistence/lib/Doctrine/Common/Persistence/Mapping/AbstractClassMetadataFactory.php:183
/Users/simon/projects/stokl/backend/vendor/doctrine/persistence/lib/Doctrine/Common/Persistence/Mapping/AbstractClassMetadataFactory.php:89

How to reproduce

This is from in a test case in a Symfony application

    $entityManager =
      $kernel->getContainer()->get('doctrine.orm.entity_manager');

    $metadatas = $entityManager->getMetadataFactory()->getAllMetadata();
@Majkl578
Copy link
Contributor

Hi,
thanks for a prompt testing of 2.6.2! Here's a quick fix: #7307

Note that the deprecations in doctrine/common are silent (using @) so nothing is really broken - your tests are explicitly using an unsilencer.

Your tests should be using weak_vendors mode for the Symfony's PHPUnit listener to ignore deprecations coming from vendor/ (those not triggered by your code). Otherwise your tests may start failing unexpectedly anytime and you won't be able to fix them as the code in question is out of scope.

Given the above, I am not convinced this would justify a 2.6.3 hotfix release. @Ocramius your thoughts?

@simonwelsh
Copy link
Author

I was not aware of that option. Certainly makes this less urgent! Thanks for telling me about it :)

@jmsche
Copy link

jmsche commented Jul 13, 2018

How would you silence the deprecation in the Symfony WDT?

@Majkl578
Copy link
Contributor

How would you silence the deprecation in the Symfony WDT?

It shouldn't be triggered in first place, vendor deprecations are not fault of your code and should be ignored. If this is the default behavior of Symfony WDT, then it's wrong behavior.

Either way this issue isn't the appropriate place to discuss configuration of Symfony or related issues. See symfony/symfony#27936.

@ChangePlaces
Copy link

It's nice to know that despite what the warnings allude to, all's good with doctrine.

@Majkl578
Copy link
Contributor

Closing here as resolved, fix will be released in 2.6.3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants