MediaTagSearch   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 9
c 1
b 0
f 0
dl 0
loc 15
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A search() 0 13 1
1
<?php
2
/**
3
 * Created for IG Monitoring.
4
 * User: jakim <[email protected]>
5
 * Date: 2018-09-26
6
 */
7
8
namespace app\modules\admin\models\account;
9
10
11
use app\components\stats\providers\AccountTagsDataProvider;
12
use app\components\visualizations\DateHelper;
13
use app\models\Account;
14
use Yii;
15
use yii\base\Model;
16
17
class MediaTagSearch extends Model
18
{
19
    public function search(Account $model)
20
    {
21
        $dateRange = DateHelper::getRangeFromUrl();
22
        list($from, $to) = DateHelper::normalizeRange($dateRange);
0 ignored issues
show
Bug introduced by
It seems like $dateRange can also be of type array; however, parameter $dateRange of app\components\visualiza...elper::normalizeRange() does only seem to accept string, maybe add an additional type check? ( Ignorable by Annotation )

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

22
        list($from, $to) = DateHelper::normalizeRange(/** @scrutinizer ignore-type */ $dateRange);
Loading history...
23
24
        $dataProvider = Yii::createObject([
25
            'class' => AccountTagsDataProvider::class,
26
            'account' => $model,
27
            'from' => $from,
28
            'to' => $to,
29
        ]);
30
31
        return $dataProvider;
32
    }
33
}