RequestEvent::getRequest()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

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