[DependencyInjection] fix PhpDumper

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | yes
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #12815
| License       | MIT
| Doc PR        | none