Oauth2UniqueTokenIdentifierConstraintViolationException   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
eloc 5
c 0
b 0
f 0
dl 0
loc 15
ccs 4
cts 4
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A create() 0 7 2
1
<?php
2
3
namespace rhertogh\Yii2Oauth2Server\exceptions;
4
5
use League\OAuth2\Server\Exception\UniqueTokenIdentifierConstraintViolationException;
6
use rhertogh\Yii2Oauth2Server\interfaces\exceptions\Oauth2ServerExceptionInterface;
7
8
// phpcs:ignore Generic.Files.LineLength.TooLong
9
class Oauth2UniqueTokenIdentifierConstraintViolationException extends UniqueTokenIdentifierConstraintViolationException implements
10
    Oauth2ServerExceptionInterface
11
{
12
    /**
13
     * @inheritDoc
14
     * @param null $message
0 ignored issues
show
Documentation Bug introduced by
Are you sure the doc-type for parameter $message is correct as it would always require null to be passed?
Loading history...
15
     * @return static
16
     */
17 2
    public static function create($errorMessage = null)
18
    {
19 2
        if (empty($errorMessage)) {
20 1
            $errorMessage = 'Could not create unique access token identifier';
21
        }
22
23 2
        return new static($errorMessage, 100, 'access_token_duplicate', 500);
24
    }
25
}
26