Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
InjectExtension not work when set factory and type #218
$definitions[$name] = $builder->addDefinition($this->prefix('controller.' . $name)) ->setType(IController::class) ->addTag(InjectExtension::TAG_INJECT) ->setFactory($controller);
InjectExtension search inject* methods in IController instead of
Is it bug or do I have to remove interface as type?
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.