Passed
Push — master ( f76f45...88719b )
by Mattia
04:38
created

AccountCreatedListener   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
c 1
b 0
f 0
dl 0
loc 11
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A handle() 0 6 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace App\Listeners\Account;
6
7
use App\Events\Account\AccountCreatedEvent;
8
use App\Models\AccountStats;
9
10
class AccountCreatedListener
11
{
12
    /**
13
     * @param AccountCreatedEvent $event
14
     */
15
    public function handle(AccountCreatedEvent $event): void
16
    {
17
        AccountStats::create([
18
            'uuid' => $event->getAccount()->uuid,
19
            'count_request' => 0,
20
            'request_at' => null,
21
        ]);
22
    }
23
}
24