Oauth2EncryptionKeyFactory   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 3
c 1
b 0
f 0
dl 0
loc 14
ccs 2
cts 2
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A createFromAsciiSafeString() 0 3 2
1
<?php
2
3
namespace rhertogh\Yii2Oauth2Server\components\factories\encryption;
4
5
use Defuse\Crypto\Key;
6
use rhertogh\Yii2Oauth2Server\interfaces\components\factories\encryption\Oauth2EncryptionKeyFactoryInterface;
7
use yii\base\Component;
8
9
class Oauth2EncryptionKeyFactory extends Component implements Oauth2EncryptionKeyFactoryInterface
10
{
11
    /**
12
     * Default value for `createFromAsciiSafeString()` doNotTrim parameter.
13
     * @var bool
14
     */
15
    public $doNotTrim = false;
16
17
    /**
18
     * @inheritDoc
19
     */
20 5
    public function createFromAsciiSafeString($keyString, $doNotTrim = null)
21
    {
22 5
        return Key::loadFromAsciiSafeString($keyString, $doNotTrim !== null ? $doNotTrim : $this->doNotTrim);
23
    }
24
}
25