Skip to content

Lumen - Registering Class in Service Provider #14

Open
@memoishin

Description

@memoishin

I am registering an Aspect class in the AopServiceProvider. However, it does not seem to work.

Here is my code:

public function register()
{
     $this->app->singleton(LoggingAspect::class, function (Application $app) {
        return new LoggingAspect($app->make(LoggerInterface::class));
    });

    $this->app->tag([LoggingAspect::class], 'goaop.aspect');
}

Now even if I have the code as this:

public function register()
{
     $this->app->singleton(LogsasasagingAspect::class, function (Application $app) {
        return new LoggingAspect($app->make(LoggesasarInterface::class));
    });

    $this->app->tag([LoggasaingAspect::class], 'goaop.aspect');
}

It still doesn't show any error.

This service provider has been registered as:

$app->register(App\Providers\AopServiceProvider::class);
Is this normal or is there any fix for this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions