laravel/framework — pull request #6724 by hannesvdvreken (2014-12-18 21:47:34+00:00)
Title: [5.0] Added Container::resolvingType and Container::afterResolvingType

Added methods `resolvingType` and `afterResolvingType`.

This would eliminate the need to execute a callable registered with `afterResolving` like [here](https://github.com/laravel/framework/blob/34eaa5a1fc1180430dfb70545ebe60738320d750/src/Illuminate/Validation/ValidationServiceProvider.php#L31).

```php
interface Baz {}
class Bar implements Baz {}
class Foo extends Bar {}

$container = new \Illuminate\Container\Container();

$container->afterResolvingType('Baz', function () {
// This gets executed.
});

$container->make('Foo');
```

or in the example of the `ValidationServiceProvider`:

```php
$this->app->afterResolvingAny('Illuminate\Contracts\Validation\ValidatesWhenResolved', function($resolved)
{
$resolved->validate();
});
```

If you like this I can back this up with tests.