Completed
Pull Request — master (#1028)
by
unknown
05:34
created

RequestEvent::refreshTokenIssued()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 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
namespace League\OAuth2\Server\Event;
12
13
use Psr\EventDispatcher\StoppableEventInterface;
14
use Psr\Http\Message\ServerRequestInterface;
15
16
class RequestEvent implements StoppableEventInterface
17
{
18
    /**
19
     * @var ServerRequestInterface
20
     */
21
    private $request;
22
23
    /**
24
     * @var bool
25
     */
26
    protected $isPropagationStopped = false;
27
28
    /**
29
     * RequestEvent constructor.
30
     *
31
     * @param string                 $name
0 ignored issues
show
Bug introduced by
There is no parameter named $name. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
32
     * @param ServerRequestInterface $request
33
     */
34 30
    public function __construct(ServerRequestInterface $request)
35
    {
36 30
        $this->request = $request;
37 30
    }
38
39
    public function stopPropagation()
40
    {
41
        $this->isPropagationStopped = true;
42
    }
43
44
    public function isPropagationStopped(): bool
45
    {
46
        return $this->isPropagationStopped;
47
    }
48
49
    /**
50
     * @return ServerRequestInterface
51
     * @codeCoverageIgnore
52
     */
53
    public function getRequest()
54
    {
55
        return $this->request;
56
    }
57
58 13
    public static function clientAuthenticationFailed(ServerRequestInterface $request): self
59
    {
60 13
        return new ClientAuthenticationFailedEvent($request);
61
    }
62
63 15
    public static function accessTokenIssued(ServerRequestInterface $request): self
64
    {
65 15
        return new AccessTokenIssuedEvent($request);
66
    }
67
68 1
    public static function userAuthenticationFailed(ServerRequestInterface $request): self
69
    {
70 1
        return new UserAuthenticationFailedEvent($request);
71
    }
72
73 7
    public static function refreshTokenIssued(ServerRequestInterface $request): self
74
    {
75 7
        return new RefreshTokenIssuedEvent($request);
76
    }
77
78 1
    public static function refreshTokenClientFailed(ServerRequestInterface $request): self
79
    {
80 1
        return new RefreshTokenClientFailedEvent($request);
81
    }
82
}
83