Review 10.4 Merged

71481[DOCS] Recommend $container->hasDefinition() for optional dependencies

Christian Kuhn CR +2 V +2 Easy +11 −5 updated 10/07/21, 11:53

Commit message

ExtensionManagementUtility() usage in Services.php has never been an
intended usage, but was technically possible in TYPO3 v10 as a side
effect of runtime activated packages, and therefore got documented in
example code.

Container builds should generally be stateless and should only take
explicit service configuration and ContainerBuilder compile time
state into account. Therefore conditional service registration should
only use compile time container state, which can be achieved with:
ContainerBuilder->hasDefinition(ClassNameOfOptionalDependency::class)

Review

  • Code review CR +2

    Imported before Forger kept the single votes, the next import adds them.

  • Verified V +2

    Imported before Forger kept the single votes, the next import adds them.

Issues 2

Files 1