Passed
Pull Request — master (#1184)
by
unknown
48:55 queued 13:43
created

UserAuthenticationFailed   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 6
dl 0
loc 17
c 1
b 0
f 0
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 1
A getUsername() 0 3 1
1
<?php
2
3
namespace League\OAuth2\Server\Events;
4
5
use Psr\Http\Message\ServerRequestInterface;
6
7
final class UserAuthenticationFailed extends AbstractEvent
8
{
9
    /** @var string|null */
10
    private $username;
11
12
    public function __construct(
13
        ?string $username,
14
        ServerRequestInterface $request
15
    ) {
16
        parent::__construct($request);
17
        $this->name = 'user.authentication.failed';
18
        $this->username = $username;
19
    }
20
21
    public function getUsername(): ?string
22
    {
23
        return $this->username;
24
    }
25
}