AbstractEvent   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A auth() 0 3 1
A __construct() 0 4 1
A user() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Jasny\Auth\Event;
6
7
use Jasny\Auth\Auth;
8
use Jasny\Auth\UserInterface as User;
9
10
/**
11
 * Base class for all auth events.
12
 */
13
abstract class AbstractEvent
14
{
15
    protected Auth $auth;
16
    protected User $user;
17
18
    /**
19
     * AbstractEvent constructor.
20
     */
21 2
    public function __construct(Auth $auth, User $user)
22
    {
23 2
        $this->auth = $auth;
24 2
        $this->user = $user;
25
    }
26
27
    /**
28
     * Get the Auth service.
29
     */
30 1
    final public function auth(): Auth
31
    {
32 1
        return $this->auth;
33
    }
34
35
    /**
36
     * Get the user.
37
     */
38 1
    final public function user(): User
39
    {
40 1
        return $this->user;
41
    }
42
}
43