EventServiceProvider::boot()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 5
rs 10
1
<?php
2
3
namespace App\Providers;
4
5
use App\Events\InteractionOnPage;
6
use App\Events\UserDeleted;
7
use App\Events\UserLeaveOrganization;
8
use App\Listeners\AnonymizeUserResponse;
9
use App\Listeners\SendCustomEmailVerificationNotification;
10
use App\Listeners\SetInteractionToRegisteredUserListener;
11
use App\Listeners\SetPageDryStateListener;
12
use App\Observers\PageObserver;
13
use App\Src\UseCases\Infra\Sql\Model\PageModel;
14
use Illuminate\Auth\Events\Registered;
15
use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;
16
17
class EventServiceProvider extends ServiceProvider
18
{
19
    protected $listen = [
20
        Registered::class => [
21
            SendCustomEmailVerificationNotification::class,
22
            SetInteractionToRegisteredUserListener::class
23
        ],
24
        InteractionOnPage::class => [
25
            SetPageDryStateListener::class,
26
            SetInteractionToRegisteredUserListener::class
27
        ],
28
        UserDeleted::class => [
29
            AnonymizeUserResponse::class
30
        ],
31
        UserLeaveOrganization::class => [
32
            AnonymizeUserResponse::class
33
        ]
34
    ];
35
36
    public function boot()
37
    {
38
        parent::boot();
39
40
        PageModel::observe(PageObserver::class);
41
    }
42
}
43