OneTimeKeyAction::get()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 4
nc 1
nop 1
dl 0
loc 9
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace yrc\actions;
4
5
use yrc\rest\Action as RestAction;
6
use yrc\models\redis\EncryptionKey;
7
use Yii;
8
9
class OneTimeKeyAction extends RestAction
10
{
11
    /**
12
     * Generates a one time key pair to authenticate further authentication sessions
13
     * @return array
14
     */
15
    public function get($params)
0 ignored issues
show
Unused Code introduced by
The parameter $params is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

15
    public function get(/** @scrutinizer ignore-unused */ $params)

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
16
    {
17
        // Generate a one time key pair
18
        $model = EncryptionKey::generate(true);
19
20
        // Return the public keys, and a signature of the public key
21
        return [
22
            'public' => \base64_encode($model->getBoxPublicKey()),
23
            'hash' => $model->hash
24
        ];
25
    }
26
}
27