ResourceServer::makeCryptKey()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 0
cts 3
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 2
1
<?php
2
3
namespace CodexShaper\OAuth2\Server;
4
5
use CodexShaper\OAuth2\Server\Repositories\AccessTokenRepository;
6
use League\OAuth2\Server\CryptKey;
7
use League\OAuth2\Server\ResourceServer as LeagueResourServer;
8
9
class ResourceServer
10
{
11
    public function __construct()
12
    {
13
        return new LeagueResourServer(
0 ignored issues
show
Bug introduced by
Constructors do not have meaningful return values, anything that is returned from here is discarded. Are you sure this is correct?
Loading history...
14
            new AccessTokenRepository(),
15
            $this->makeCryptKey('public')
16
        );
17
    }
18
19
    /**
20
     * Create a CryptKey instance without permissions check.
21
     *
22
     * @param string $key
0 ignored issues
show
Bug introduced by
There is no parameter named $key. 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...
23
     *
24
     * @return \League\OAuth2\Server\CryptKey
25
     */
26
    protected function makeCryptKey($type)
27
    {
28
        $key = __DIR__.'/../storage/rsa/oauth-'.$type.'.key';
29
30
        return new CryptKey($key, null, false);
31
    }
32
}
33