UserRegisteredEvent::getRegistrationType()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 2
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 2
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