-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
ORM 3 deprecations #2827
Comments
This is expected behavior right now as a deprecation-free environment would require either dropping ORM 2.x support or adding way too many version checks to the code to avoid them. You can silence these deprecations through Doctrine's deprecations library with this: use Doctrine\Deprecations\Deprecation;
// Ignore unfixable Doctrine deprecations
Deprecation::ignoreDeprecations(
'https://github.com/doctrine/orm/pull/11211', // The ORM changed from arrays to named data objects in 3.x, some packages still use array access for B/C
); |
Any idea of how to implement this suppression while using StofDoctrineExtensionsBundle? |
Or just search/replace like |
You can do this in |
While it looks that simple, it adds a lot of maintenance overhead. A fair number of the uses of the mapping data is in code that runs for both the MongoDB ODM and ORM. |
Yeah, I'm so brave decided to make pull request 😄 Maybe use "BC promise", increase major version and cleanup array access then ? About ODM - just need to kick they ) |
I'm probably missing something here, but... doesn't https://3v4l.org/X018d vs https://3v4l.org/NEdul shows how it's a totally doable approach. |
It avoid, but it is not so simple "find & replace" |
I did a first attempt to solving this, at least partially, with #2889 |
Maybe it's obvious but I didn't know where to put this code. I added it to With Symfony Flex, you should already have this file if you use |
@alexislefebvre I managed to silence the deprecation by editing namespace App;
use Doctrine\Deprecations\Deprecation;
use Symfony\Bundle\FrameworkBundle\Kernel\MicroKernelTrait;
use Symfony\Component\HttpKernel\Kernel as BaseKernel;
class Kernel extends BaseKernel
{
use MicroKernelTrait;
public function __construct(string $environment, bool $debug)
{
parent::__construct($environment, $debug);
// Ignore unfixable Doctrine deprecations
Deprecation::ignoreDeprecations(
'https://github.com/doctrine/orm/pull/11211', // The ORM changed from arrays to named data objects in 3.x, some packages still use array access for B/C
);
}
} |
It worked only for tests as this file defined as tests bootstrap in phpunit config by symfony flex |
Environment
Package
show
Doctrine packages
show
PHP version
Subject
After update to latest (3.16.0) version which support ORM 3 there are deprecations appear in symfony debug toolbar.
DoctrineExtensions/src/Tree/Mapping/Validator.php
Line 100 in c1c2455
DoctrineExtensions/src/Mapping/Driver/AbstractAnnotationDriver.php
Line 134 in c1c2455
etc
The text was updated successfully, but these errors were encountered: