Contextual Binding Not Working
I'm defining a contextual binding within a Service Provider like so: $this->app->when('Sky\Service')->needs('Sky\Interface')->give(function() { return Setting::get('carrier.voip360'); // I'm expecting this to be called });
I'm defining a default binding like so: $this->app->singleton('Sky\Interface', function() { return Setting::get('carrier.starnet'); // this is unexpectedly called });
I'm then define the instantiation of class which SHOULD use the contextual binding but does not $this->app->singleton('Sky\Service', function() { return new \Sky\Carrier\Starnet\Service( $this->app->make('Illuminate\Contracts\Logging\Log'), $this->app['cache']->driver(), $this->app->make('Sky\Interface') ); });
I've tracked the issue through to \Illuminate\Container\Container@getContextualConcrete. It seems that this method is expecting the last item in Container->buildStack to be 'Sky\Service' but it is not. It does not seem like Container->buildStack is getting updated properly.
We're open to PRs.
does it make sense to acknowledge a bug in a ticket and close it? Wouldn't it make sense to keep the ticket open to acknowledge an issue until it can be fixed, maybe by a pull request?