IndexAction::run()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 12
rs 9.4285
cc 1
eloc 5
nc 1
nop 0
1
<?php
2
3
namespace zacksleo\yii2\post\actions;
4
5
use yii\data\ActiveDataProvider;
6
use yii\base\Action;
7
use zacksleo\yii2\post\models\Post;
8
9
class IndexAction extends Action
10
{
11
    public function run()
12
    {
13
        return new ActiveDataProvider(
14
            [
15
                'query' => Post::find()->where(
16
                    [
17
                        'status' => POST::STATUS_ACTIVE
18
                    ]
19
                )->orderBy('order DESC')
20
            ]
21
        );
22
    }
23
}
24