UserRegisteredEvent   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 75%

Importance

Changes 0
Metric Value
dl 0
loc 24
c 0
b 0
f 0
wmc 3
lcom 0
cbo 1
ccs 6
cts 8
cp 0.75
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getUser() 0 4 1
A getRegistrationType() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace App\Users\Event;
6
7
use App\Users\Entity\User;
8
use Symfony\Component\EventDispatcher\Event;
9
10
class UserRegisteredEvent extends Event
0 ignored issues
show
Deprecated Code introduced by
The class Symfony\Component\EventDispatcher\Event has been deprecated with message: since Symfony 4.3, use "Symfony\Contracts\EventDispatcher\Event" instead

This class, trait or interface has been deprecated. The supplier of the file has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the type will be removed from the class and what other constant to use instead.

Loading history...
11
{
12
    const NAME = 'user.registered';
13
    const TYPE_DEFAULT_REGISTRATION = 'default';
14
15
    protected $user;
16
    protected $type;
17
18 2
    public function __construct(User $user, string $type = self::TYPE_DEFAULT_REGISTRATION)
19
    {
20 2
        $this->user = $user;
21 2
        $this->type = $type;
22 2
    }
23
24 2
    public function getUser(): User
25
    {
26 2
        return $this->user;
27
    }
28
29
    public function getRegistrationType(): string
30
    {
31
        return $this->type;
32
    }
33
}
34