InvalidGrantException::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 2
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace kalanis\OAuth2\Exceptions;
4
5
6
use Exception;
7
8
9
/**
10
 * InvalidGrantException is thrown when provided authorization grant (authorization vode, resource owner credentials)
11
 * or refresh token is invalid, expired, revoked, does not match redirect URI used in authorization request
12
 * @package kalanis\OAuth2\Exceptions
13
 */
14
class InvalidGrantException extends OAuthException
15
{
16
17
    protected string $key = 'invalid_grant';
18
19
20
    /**
21
     * @param string $message
22
     * @param Exception|null $previous
23
     */
24
    public function __construct($message = 'Givent grant token is invalid or expired', Exception $previous = null)
25
    {
26
        parent::__construct($message, 400, $previous);
27
    }
28
}
29