-
-
Notifications
You must be signed in to change notification settings - Fork 70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
InjectExtension not work when set factory and type #218
Comments
I guess you should use |
Thanks, but IController is not a factory, I guess IController: interface IController {
public function start(IRequest $request, IClient $client): void;
} |
FactoryDefinition is for factories generated from interface, while setFactory() define how is instance created (@foo::getInstance() for $this->getService('foo')->getInstance() or Foo::class for new Foo), these things are not related.
If you put definition into neon with factory and type keys defined - is it working? Imho it's problem with priorities, not with extension itself. |
Not working: factory: App\TestService
type: App\ITestService
inject: true Working: factory: App\TestService
inject: true |
Version: 3.0.1
InjectExtension search inject* methods in IController instead of
$controller
https://github.com/nette/di/blob/master/src/DI/Extensions/InjectExtension.php#L64
Is it bug or do I have to remove interface as type?
The text was updated successfully, but these errors were encountered: