-
-
Notifications
You must be signed in to change notification settings - Fork 202
Closed
Labels
Description
Hi there,
I cannot use constructor injection of HubInterface and Hub and have to add:
$this->app->when(MyService::class)
->needs(HubInterface::class)
->give(
function (): HubInterface {
return $this->app->get('sentry');
}
);
Having several instances of Sentry sounds not really correct for me, since different services add breadcrumbs. Moreover, you sentry works as singleton. Why not bind interface as well?
I assume there should be some drawback but have no idea which one is it.
Thanks!