Passed
Pull Request — master (#97)
by
unknown
03:04
created

UserLoggedInMessage   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
eloc 5
c 1
b 0
f 0
dl 0
loc 16
ccs 6
cts 6
cp 1
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getData() 0 5 1
A __construct() 0 2 1
A getHandlerName() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace App\Queue;
6
7
use Yiisoft\Yii\Queue\Message\AbstractMessage;
8
9
final class UserLoggedInMessage extends AbstractMessage
10
{
11 1
    public function __construct(private string $userId, private int $time)
12
    {
13
    }
14
15 1
    public function getHandlerName(): string
16
    {
17 1
        return LoggingAuthorizationHandler::NAME;
18
    }
19
20 1
    public function getData(): array
21
    {
22
        return [
23 1
            'user_id' => $this->userId,
24 1
            'time' => $this->time,
25
        ];
26
    }
27
}
28