createFromAsciiSafeString()   A
last analyzed

Complexity

Conditions 2
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
cc 2
nc 1
nop 2
crap 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