RequestEvent   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 8
dl 0
loc 20
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A getRequest() 0 3 1
1
<?php
2
3
/**
4
 * @author      Alex Bilbie <[email protected]>
5
 * @copyright   Copyright (c) Alex Bilbie
6
 * @license     http://mit-license.org/
7
 *
8
 * @link        https://github.com/thephpleague/oauth2-server
9
 */
10
11
declare(strict_types=1);
12
13
namespace League\OAuth2\Server;
14
15
use League\OAuth2\Server\EventEmitting\AbstractEvent;
16
use Psr\Http\Message\ServerRequestInterface;
17
18
class RequestEvent extends AbstractEvent
19
{
20
    public const CLIENT_AUTHENTICATION_FAILED = 'client.authentication.failed';
21
    public const USER_AUTHENTICATION_FAILED = 'user.authentication.failed';
22
    public const REFRESH_TOKEN_CLIENT_FAILED = 'refresh_token.client.failed';
23
24
    public const REFRESH_TOKEN_ISSUED = 'refresh_token.issued';
25
    public const ACCESS_TOKEN_ISSUED = 'access_token.issued';
26
27 40
    public function __construct(string $name, private ServerRequestInterface $request)
28
    {
29 40
        parent::__construct($name);
30
    }
31
32
    /**
33
     * @codeCoverageIgnore
34
     */
35
    public function getRequest(): ServerRequestInterface
36
    {
37
        return $this->request;
38
    }
39
}
40