Skip to content

Is there any reason why Hub/HubInterface is not bound? #248

@SCIF

Description

@SCIF

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!

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions