Details
Description
We have the following definition of RepositoryFactory in the Repository layer of ibexa/core
Ibexa\Bundle\Core\ApiLoader\RepositoryFactory: class: Ibexa\Core\Base\Container\ApiLoader\RepositoryFactory # ... Ibexa\Core\Repository\Repository: factory: ['@Ibexa\Bundle\Core\ApiLoader\RepositoryFactory', buildRepository]
The bundle class is formally not available in that layer, so it was defined as an alias which is then overridden on a full stack bundle level. While this works, it causes headache for PHPStorm's static analysis, Symfony Rectors, and in the past it caused a difficult to track permission resolver-related bug, because 2 definitions of RepositoryFactory exist in the DI container and in one of them landed an uninitialized instance of permission resolver.
The latter case was solved by laziness, however the proper fix is to actually move Bundle logic to Repository layer by providing proper abstraction (see IBX-8399) and use only one RepositoryFactory - from the Repository layer.