Passed
Push — master ( 7ba57e...634515 )
by Paweł
03:13
created

MediaAccountSearch   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 9
dl 0
loc 16
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A search() 0 14 1
1
<?php
2
/**
3
 * Created for IG Monitoring.
4
 * User: jakim <[email protected]>
5
 * Date: 2018-09-27
6
 */
7
8
namespace app\modules\admin\models\account;
9
10
11
use app\components\stats\providers\AccountAccountsDataProvider;
12
use app\components\visualizations\DateHelper;
13
use app\models\Account;
14
use Yii;
15
16
class MediaAccountSearch extends StatsSearch
17
{
18
    public function search(Account $model, array $params = [])
0 ignored issues
show
Unused Code introduced by
The parameter $params is not used and could be removed. ( Ignorable by Annotation )

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

18
    public function search(Account $model, /** @scrutinizer ignore-unused */ array $params = [])

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
19
    {
20
        $dateRange = DateHelper::getRangeFromUrl();
21
        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

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