I am using Symfony 3.4.12 and can't find any information about how to solve this deprecation:
User Deprecated: Doctrine\Common\ClassLoader is deprecated.
Any suggestion?
The Doctrine Common
package will be split into small packages and the ClassLoader
component will be dropped, that's why the deprecation notice.
See https://github.com/doctrine/common/issues/826 and https://www.doctrine-project.org/2018/07/12/common-2-9-and-dbal-2-8-and-orm-2-6-2.html.
If you are using the package doctrine/common
directly then the solution would be to remove that dependency and add the individual packages instead.
If you are using Symfony there is already a PR to change that: https://github.com/symfony/symfony/pull/27609. So in any new version, the deprecation should be gone.
In this case (https://pasteboard.co/HJOKbzk.png), we have 2 ways:
- when running phpunit in console set environment variable, like this:
$ SYMFONY_DEPRECATIONS_HELPER=weak ./vendor/bin/phpunit
show simple notice in result: Remaining deprecation notices (1)
(https://pasteboard.co/HJONdvJ.png)
besides, we can use this option:
$ SYMFONY_DEPRECATIONS_HELPER=weak_vendors ./vendor/bin/phpunit
we will get a more strict warning (https://pasteboard.co/HJOOZH9.png)
- we can also add a variable to the phpunit configuration (phpunit.xml[.dist])
<phpunit ...>
<php>
...
<env name="SYMFONY_DEPRECATIONS_HELPER" value="weak_vendors" />
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With