Dependency injection

All services are bundled in a service container. This container is built during bootstrapping. It depends on the following resources:

  • Default service configuration, located at config of this package

  • Project type specific service configuration, located at config within an external template repository

Tagged services

Some special services exist that are tagged during container build-time:

Tag name

Resource

builder.writer

Builder\Writer\WriterInterface

event.listener

expression_language.provider

Symfony\Component\ExpressionLanguage\ExpressionFunctionProviderInterface

generator.step

Builder\Generator\Step\StepInterface

io.validator

IO\Validator\ValidatorInterface

twig.filter

Twig\Filter\TwigFilterInterface

twig.function

Twig\Func\TwigFunctionInterface

Synthetic services

The following services are configured to be synthetic. They are added to the compiled container during bootstrapping.

Service id

Class name

app.config

Builder\Config\Config

app.messenger

IO\Messenger

Extending service configuration

Service configuration can be extended by each project type. Once a user selects a project type during bootstrapping, the project type’s template directory is being searched for the following resources:

  • config/services.php

  • config/services.yaml

  • config/services.yml

Tip

You can define more than one service configuration per project type.