Если вы создали Constraint и ConstraintValidator вам совсем не нужен контейнер DI.. Скажем, например, вы хотите протестировать ограничение Type из Symfony и это TypeValidator.
injection - Sollte in Symfony 2.x wirklich alles ein Bundle sein? [name]_connection service where … Wenn du jetzt den Service \App\Reg\TestType abrufen möchtest, existiert dieser nicht, da du ein \ zuviel hast am Anfang.
Symfony Whenever you make a change to the service configuration Symfony will regenerate a … This will grow as you add more functionality to your API, so in some cases you might want multiple endpoints. Fatal error: Uncaught Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException: The "post_voter" service or alias has been removed or inlined when the container was compiled.
Alias That means, in ArticleController, instead of needing to say new MarkdownHelper(), we can autowire it: add … [sic] To workaround the issue,
Symfony Вы также можете контролировать опцию public на основании каждого сервиса:
Services and dependency injection in Drupal