Skip to content
Latchkey

Symfony "lint:container" service wiring check failed in CI

lint:container compiles the container and validates that every argument can be resolved. A failure means at least one service references a type, id, or argument the container cannot satisfy, which would also crash the app at boot.

What this error means

A CI step running bin/console lint:container exits non-zero and prints the offending service and argument, for example an unresolvable typed argument or a missing referenced id.

Symfony
In CheckTypeDeclarationsPass.php line 175:
  Invalid definition for service "App\Service\Invoicer": argument 1 of
  "App\Service\Invoicer::__construct()" accepts "App\Client\PaymentClientInterface",
  "string" passed.

Common causes

An argument type does not match the definition

A bound value or referenced service does not satisfy the constructor type hint, so the container definition is invalid.

A referenced service or interface is unresolvable

The definition points at an id or interface with no matching service, the same class of problem that autowiring reports at boot.

How to fix it

Read the failing definition and correct the argument

  1. Run lint:container with the CI environment to see the exact service and argument.
  2. Fix the binding so the value or referenced service matches the type hint.
  3. Re-run until the linter reports the container is valid.
Terminal
APP_ENV=test php bin/console lint:container

Alias interfaces the linter cannot resolve

Provide an alias from the interface to a concrete service so typed arguments resolve during compilation.

config/services.yaml
# config/services.yaml
services:
    App\Client\PaymentClientInterface: '@App\Client\StripePaymentClient'

How to prevent it

  • Run lint:container in CI so wiring problems fail before deploy.
  • Keep argument bindings and type hints consistent.
  • Alias every injectable interface to a concrete implementation.

Frequently asked questions

What causes ""lint:container" reports invalid wiring"?
A bound value or referenced service does not satisfy the constructor type hint, so the container definition is invalid.
How do I fix "lint:container" reports invalid wiring?
Read the failing definition and correct the argument

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card