SignedIn::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 2
dl 0
loc 4
ccs 0
cts 3
cp 0
crap 2
rs 10
1
<?php
2
3
namespace Slides\Saml2\Events;
4
5
use Slides\Saml2\Saml2User;
6
use Slides\Saml2\Auth;
7
8
/**
9
 * Class LoggedIn
10
 *
11
 * @package Slides\Saml2\Events
12
 */
13
class SignedIn
14
{
15
    /**
16
     * The signed-up user.
17
     *
18
     * @var Saml2User
19
     */
20
    public $user;
21
22
    /**
23
     * The authentication handler.
24
     *
25
     * @var Auth
26
     */
27
    public $auth;
28
29
    /**
30
     * LoggedIn constructor.
31
     *
32
     * @param Saml2User $user
33
     * @param Auth $auth
34
     */
35
    public function __construct(Saml2User $user, Auth $auth)
36
    {
37
        $this->user = $user;
38
        $this->auth = $auth;
39
    }
40
41
    /**
42
     * Get the authentication handler for a SAML sign in attempt
43
     *
44
     * @return Auth The authentication handler for the SignedIn event
45
     */
46
    public function getAuth(): Auth
47
    {
48
        return $this->auth;
49
    }
50
51
    /**
52
     * Get the user represented in the SAML sign in attempt
53
     *
54
     * @return Saml2User The user for the SignedIn event
55
     */
56
    public function getSaml2User(): Saml2User
57
    {
58
        return $this->user;
59
    }
60
}
61