Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
[FrameworkBundle] Remove entities from class map as it is optional #35333
This is interesting situation as this is not really a bug fix and not really a new feature.
But I am certain that this entity import to class map is in the wrong place.
My issue comes with PHP 7.4 and class preloading. Project has no doctrine ORM (using ODM instead), but other vendors has entities and those entities are preloaded now. If those entities are missing some dependencies - preloading fails with exceptions. This was not an issue until PHP 7.4, but now I have to work around this forced entity preloading. Why should Framework bundle even care about entities at all?
My temporary solution to this:
This will degrade the performance of apps that rely on cache warmers to be at full speed.
preloading should not fail with exception. Without knowing anything else and with a high chance of being wrong, I'd suspect the issue is in the thing that triggers the exception. It shouldn't.
Well I have a bundle that is supporting both Entities and Documents. ORM supporting bundle is optional and it has trait that previous bundle uses. Before PHP 7.4 it was no issue as no one used those entity classes and no one missed this trait, but now entities are actually executed.
As I mentioned before
Any way, in my case always loading to memory classes that I will never use is a performance issue and I will have to work it around.