Passed
Push — master ( 60854d...29b3a1 )
by Rutger
03:10
created

Oauth2PersonalAccessTokenController::actions()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 2
c 1
b 0
f 0
dl 0
loc 4
ccs 0
cts 2
cp 0
rs 10
cc 1
nc 1
nop 0
crap 2
1
<?php
2
3
namespace rhertogh\Yii2Oauth2Server\controllers\console;
4
5
use rhertogh\Yii2Oauth2Server\controllers\console\base\Oauth2BaseConsoleController;
6
use rhertogh\Yii2Oauth2Server\controllers\console\PersonalAccessToken\Oauth2GeneratePatAction;
7
use yii\helpers\ArrayHelper;
8
9
class Oauth2PersonalAccessTokenController extends Oauth2BaseConsoleController
10
{
11
    /**
12
     * @var string|null
13
     */
14
    public $client = null;
15
16
    /**
17
     * @var string|null
18
     */
19
    public $clientSecret = null;
20
21
    /**
22
     * @var string|null
23
     */
24
    public $user = null;
25
26
    /**
27
     * @var string|null
28
     */
29
    public $scope = null;
30
31
    /**
32
     * @inheritDoc
33
     */
34
    public function options($actionID)
35
    {
36
        if ($actionID == 'generate') {
37
            $options = [
38
                'client',
39
                'clientSecret',
40
                'user',
41
                'scope',
42
            ];
43
        }
44
45
        return ArrayHelper::merge(parent::options($actionID), $options ?? []);
46
    }
47
48
    /**
49
     * @inheritDoc
50
     */
51
    public function actions()
52
    {
53
        return [
54
            'generate' => Oauth2GeneratePatAction::class,
55
        ];
56
    }
57
}
58