[DependencyInjection] use/fix newest Definition::setFactory

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -
hmm, resolving the factory class but not the function callable is a bit inconsistent though.