Skip to content

Use $container->call() for calling DI\factory functions #197

@ewinslow

Description

@ewinslow

Right now when you use DI\factory you have to do:

factory(function(Container $c) {
  return new Thing($c->get(Service::class));
});

What I'd really like to do is this:

factory(function(Service $s) {
  return new Thing($s);
});

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions