FluidTYPO3 / vhs

TYPO3 extension VHS: Fluid ViewHelpers
https://fluidtypo3.org
Other
189 stars 228 forks source link

[TASK] Add Service.yaml to expose classes as services for DI #1700

Closed Konafets closed 1 year ago

Konafets commented 3 years ago

When migrating from $objectManager->get() to constructor dependency injection I got this error:

Cannot autowire service "Vendor\ExtensionKey\ViewHelpers\MenuViewHelper": argument "$pageService" of method "FluidTYPO3\Vhs\ViewHelpers\Menu\AbstractMenuViewHelper::injectPageService()" references class "FluidTYPO3\Vhs\Service\PageService" but no such service exists.

To be able to use constructor DI, the service needs to be exposed through an Service.yaml file. This PR adds this file.

NamelessCoder commented 1 year ago

VHS now has an appropriate set of service definitions, public=true is set for injectable classes and ViewHelpers.