orno/di — pull request #21 by dhrrgn (2014-03-26 15:46:29+00:00)
Title: Resolve Closure Arguments

You can do this with Classes, so why not Closures? If there is a reason for not doing this before, I would like to discuss it, because I can't think of any downside to this.

It allows this:

``` php
add('session.handler', function () use ($di) {
return new Session\Handler\Redis($di['redis'], $di['config']->get('session_key_prefix'));
});
```

To become this:

``` php
add('session.handler', function ($redis, $config) {
return new Session\Handler\Redis($redis, $config->get('session_key_prefix'));
})->withArguments(['redis', 'config']);
```

It is a small change, but very helpful.