Virtual objects - generate proxy classes for interfaces
It should be possible to declare an interface and configure an object (e.g. singleton based on a prototype with arguments) for it in
Objects.yaml. Right now you have to write a factory class to have different singletons based on the same prototype object.
TYPO3\Example\MyInterface: scope: singleton className: TYPO3\Example\MyClass # <- scope: prototype arguments: 1: value: Foo TYPO3\Example\MyDebugInterface: scope: singleton className: TYPO3\Example\MyClass # <- scope: prototype arguments: 1: value: Bar properties: debug: value: true
There should be a generated proxy class for the interface that implements the interface. Dependency injection with the interface type should work with that automatically.
I think instantiating the interface with
new \TYPO3\Example\MyInterface() has not to work since it's also contra-intuitive to the default PHP behaviour. So DI or the ObjectManager must be used for that.
No data to display