View::run()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 4
nc 1
nop 1
dl 0
loc 8
ccs 5
cts 5
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace roaresearch\yii2\roa\actions;
4
5
use roaresearch\yii2\roa\hal\ARContract;
6
use Yii;
7
8
class View extends Action
9
{
10
    /**
11
     * @return ARContract
12
     * @param mixed $id
13
     */
14 2
    public function run($id): ARContract
15
    {
16 2
        $this->checkAccess(
17 2
            ($model = $this->findModel($id)),
18 2
            Yii::$app->getRequest()->getQueryParams()
19
        );
20
21 2
        return $model;
0 ignored issues
show
Bug Best Practice introduced by
The expression return $model returns the type yii\db\ActiveRecordInterface which includes types incompatible with the type-hinted return roaresearch\yii2\roa\hal\ARContract.
Loading history...
22
    }
23
}
24