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 Done
    • Helmut Hummel +2
  • Verified V +2 Done
    • Helmut Hummel +2
    • core-ci +1 CI

Issues 2

Files 1

Review log 34

  1. Christian Kuhn uploaded patch set 1 10/07/21, 11:33

  2. core-ci voted on patch set 1 V +1 10/07/21, 11:43 Core CI is happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/17733

  3. Helmut Hummel voted on patch set 1 V +2 CR +2 10/07/21, 11:53

  4. Helmut Hummel merged patch set 2 10/07/21, 11:53