Client   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 7
dl 0
loc 25
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A query() 0 10 1
1
<?php
2
3
namespace Freyo\MtaH5\AdTag;
4
5
use Freyo\MtaH5\Kernel\BaseClient;
6
7
class Client extends BaseClient
8
{
9
    /**
10
     * 按天查询渠道的分析数据.
11
     *
12
     * @see https://mta.qq.com/docs/h5_api.html#%E6%B8%A0%E9%81%93%E6%95%88%E6%9E%9C%E5%88%86%E6%9E%90
13
     *
14
     * @param string       $startDate 开始时间(Y-m-d)
15
     * @param string       $endDate   结束时间(Y-m-d)
16
     * @param array|string $adTags
17
     *
18
     * @throws \Freyo\MtaH5\Kernel\Exceptions\InvalidConfigException
19
     *
20
     * @return array|\Freyo\MtaH5\Kernel\Support\Collection|object|\Psr\Http\Message\ResponseInterface|string
21
     */
22
    public function query($startDate, $endDate, $adTags)
23
    {
24
        $params = [
25
            'start_date' => $startDate,
26
            'end_date'   => $endDate,
27
            'adtags'     => implode((array) $adTags, ','),
0 ignored issues
show
Unused Code introduced by
The call to implode() has too many arguments starting with ','. ( Ignorable by Annotation )

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

27
            'adtags'     => /** @scrutinizer ignore-call */ implode((array) $adTags, ','),

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. Please note the @ignore annotation hint above.

Loading history...
28
            'idx'        => 'pv,uv,vv,iv',
29
        ];
30
31
        return $this->httpGet('ctr_adtag', $params);
32
    }
33
}
34