AbstractEvent::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

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