Completed
Pull Request — master (#11)
by Arnold
03:10
created

AbstractEvent   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 4
c 1
b 0
f 0
dl 0
loc 18
ccs 5
cts 5
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 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 User $user;
16
17
    /**
18
     * AbstractEvent constructor.
19
     */
20 2
    public function __construct(Auth $_, User $user)
1 ignored issue
show
Unused Code introduced by
The parameter $_ is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

20
    public function __construct(/** @scrutinizer ignore-unused */ Auth $_, User $user)

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
21
    {
22 2
        $this->user = $user;
23 2
    }
24
25
    /**
26
     * Get the user.
27
     */
28 1
    final public function user(): User
29
    {
30 1
        return $this->user;
31
    }
32
}
33