IndexAction   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
c 1
b 0
f 0
lcom 0
cbo 4
dl 0
loc 15
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A run() 0 12 1
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