neos-development-collection icon indicating copy to clipboard operation
neos-development-collection copied to clipboard

Make `ContentRepositoryServiceFactoryInterface` internal, and remove usages in Neos.Neos

Open mhsdesign opened this issue 2 years ago • 5 comments

Initially it seemed that the ContentRepository should not know much about all things, thus we have the ContentRepositoryServiceFactoryInterface pattern.

That lead to @deprecated really un-nice :D cr services, that will do funny hanstands to get the variation graph or dimension source:

  • DimensionControllerInternals.php
  • WorkspacesControllerInternals.php
  • DimensionsMenuItemsImplementationInternals.php
  • FusionExceptionViewInternals.php

The variation graph and dimension source were exposed on the cr via https://github.com/neos/neos-development-collection/pull/3906

The question is if we should follow that lead and expose all things on the cr via getters (at least the api stuff) and maybe have an internal getInternals method for the leftovers from ContentRepositoryServiceFactoryDependencies.

With https://github.com/neos/neos-development-collection/pull/4310 the services where also no singletons per cr anymore see removed ContentRepositoryRegistry::$contentRepositoryServiceInstances and by that the buildService pattern has no real gain.

@grebaldi suggested that instead of adding a getInternals to the cr, we could use a custom content repository factory for testing that will expose the dependencies somehow (hole through space) and thus we would be able to fetch them.

Currently we are relying on reflection to get the NodeFactory for example: https://github.com/neos/neos-development-collection/blob/00a60f391d749b146812b6153362a12d50bff7e3/Neos.ContentRepository.LegacyNodeMigration/Tests/Behavior/Bootstrap/FeatureContext.php#L130

mhsdesign avatar Oct 20 '23 21:10 mhsdesign